it is not 'universe repo' problem, this post was suggested by forum member How do I enable the "Universe" repository?. It is because missing some depends, see the answer below.
How to install libgdal on ubuntu 20.04.2 server? I got the following errors:
$ sudo apt install libgdal-dev
...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libgdal-dev : Depends: default-libmysqlclient-dev but it is not going to be installed
The following solutions not works for me:
According to @N0rbert 's advice, here are the output of the command:
$ apt-cache policy libgdal-dev libmysqlclient-dev default-libmysqlclient-dev
libgdal-dev:
Installed: 3.0.4+dfsg-1build3
Candidate: 3.0.4+dfsg-1build3
Version table:
*** 3.0.4+dfsg-1build3 500
500 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status
libmysqlclient-dev:
Installed: 8.0.25-0ubuntu0.20.04.1
Candidate: 8.0.25-0ubuntu0.20.04.1
Version table:
*** 8.0.25-0ubuntu0.20.04.1 500
500 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 Packages
500 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 Packages
100 /var/lib/dpkg/status
8.0.19-0ubuntu5 500
500 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 Packages
5.7.34-1ubuntu18.04 500
500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages
default-libmysqlclient-dev:
Installed: 1.0.5ubuntu2
Candidate: 1.0.5ubuntu2
Version table:
*** 1.0.5ubuntu2 500
500 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status
Add apt info here
$ grep -r "^deb" /etc/apt/ --include=*.list
/etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config
/etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
/etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools
/etc/apt/sources.list.d/mysql.list:deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
/etc/apt/sources.list.d/linuxuprising-ubuntu-libpng12-focal.list:deb http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu focal main
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal universe
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates universe
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal multiverse
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates multiverse
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security universe
/etc/apt/sources.list:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security multiverse
/etc/apt/sources.list:deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu focal universe