libmariadb-dev、libmysqlclient-dev 和 libgdal-dev 的问题

libmariadb-dev、libmysqlclient-dev 和 libgdal-dev 的问题

我正在尝试使用以下命令安装 libgdal-dev(我真正需要的 R 包):

sudo apt-get install libgdal-dev

但后来我收到错误消息:

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).

所以我运行:

sudo apt-get -f install

这给了我:

[...]
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)

如果我尝试安装 libmysqlclient-dev;

sudo apt-get install libmysqlclient-dev

它输出:

[...]
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)

我的 /etc/apt/sources.list 在这里http://paste.debian.net/1033600/

有人知道该怎么办吗?我真的迷茫了。

非常感谢

答案1

使用以下选项libmysqlclient-dev.deb包中安装:dpkg--force-overwrite

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

如果该命令没有帮助,请尝试--force-all选项:

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

为了确保所有内容都已正确安装,请运行:

sudo apt install -f

最后,安装libgdal-dev

sudo apt install libgdal-dev

相关内容