最近在阿里云部署服务器时出现了这么一个坑
安装mysql没有问题
但是安装libmysqlclient-dev
apt-get install libmysqlclient-dev
但是出现
E: Unable to correct problems, you have held broken packages.
在更新源之后
sudo apt-get upgrade
还是没有解决这个问题
然后安装aptitude
sudo apt-get install aptitude
用apititude安装所需包,以libmysqlclient-dev为例
aptitude install libmysqlclient-dev
系统会给出解决的安装方案
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libmysqlclient-dev [Not Installed]
2) libssl-dev [Not Installed]
Accept this solution? [Y/n/q/?] n
但是选择Y第一个解决方案亲测还是不能解决问题,因此我们选n,此时会弹出第二个解决方案
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Downgrade the following packages:
1) libssl1.1 [1.1.1-1ubuntu2.1~18.04.18 (now) -> 1.1.1-1ubuntu2.1~18.04.17 (bionic-security, bionic-updates)]
Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
libssl1.1
安装完成后,这个亲测可以解决问题
顺便说一下,我觉得这应该是阿里云ubuntu18 的bug,我在自己本地虚拟机上安装并不会出现这个问题