Ubuntu18云服务器安装libmysqlclient-dev时出现E: Unable to locate package mysql-server 的解决方法

最近在阿里云部署服务器时出现了这么一个坑

安装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,我在自己本地虚拟机上安装并不会出现这个问题

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值