3

I'm trying to install libgdal-dev (for an R package I really need) using:

sudo apt-get install libgdal-dev

But then I get the error message:

The following packages have unmet dependencies:
libgdal-dev : Depends: libmysqlclient-dev
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

So I run:

sudo apt-get -f install

which gives me:

[...]
dpkg: error processing archive /var/cache/apt/archives/libmysqlclient-dev_5.7.22-0ubuntu0.16.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/share/man/man1/mysql_config.1.gz', which is also in package libmariadb-dev 1:10.3.7+maria~xenial
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/libmysqlclient-dev_5.7.22-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

If I try to install libmysqlclient-dev;

sudo apt-get install libmysqlclient-dev

it outputs:

[...]
dpkg: error processing archive /var/cache/apt/archives/libmysqlclient-dev_5.7.22-0ubuntu0.16.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/share/man/man1/mysql_config.1.gz', which is also in package libmariadb-dev 1:10.3.7+maria~xenial
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/libmysqlclient-dev_5.7.22-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

My /etc/apt/sources.list is here http://paste.debian.net/1033600/ .

Does anybody have a clue what to do? I'm really lost..

Thank you very much

1 Answers1

2

Install libmysqlclient-dev from .deb package with dpkg and --force-overwrite option:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libmysqlclient-dev_5.7.22-0ubuntu0.16.04.1_amd64.deb

If the command doesn't help, try --force-all option:

sudo dpkg -i --force-all /var/cache/apt/archives/libmysqlclient-dev_5.7.22-0ubuntu0.16.04.1_amd64.deb

To be sure everything has been installed correctly, run:

sudo apt install -f

Finally, install libgdal-dev:

sudo apt install libgdal-dev
Bob
  • 2,533
  • You saved my day, man! After upgrade to Linux Mint 20, my normal boot to Cinnamon was broken. I boot in Recovery Mode, run apt upgrade and see what packages are broken. Then I can fix them with your suggestion. – Serhii Popov Jul 04 '20 at 03:29