Unable to correct problems, you have held broken packages

On Linux, unmet dependencies are very common, which is very disturbing and time-wasting. In this article, I will give the reasons and solutions to this problem.

     Reason analysis: 

     The package that you'd like to install requires A version of another package, but you have installed wrong version B. For example:

     libglib2.0-dev : Depends: libglib2.0-0(=2.40.0-2) but 2.40.2-0ubuntu1 is to be installed

     This means that libglib2.0-dev requires the version of libglib2.0-0 to be 2.40.0-2 ! But , you have installed libglib2.0-0, whose version is 2.40.2-0ubuntu1 ......

     Solution:

     Step 1: Go to "software update center", choose the "Main Server";

     Step 2: In "update" item , choose the first three : important security updates , recommended updates and pre-release updates;

     Step 3: Install the package with correct target version which looks like:

                 sudo apt-get update

                 sudo apt-get install libpcre3-dev libpcre3=1:8.31-2ubuntu2.3

                 Where libpcre3-dev is the package you want to install , and 1:8.31-2ubuntu2.3 is the correct version required by libpcre3-dev.

      The package version can be shown via "dpkg -s PACKAGE_NAME"

      If the solution above did not solve the problem, try to use " aptitude " package manager because it is smarter than " apt-get ".

      Any questions , please leave a comment below.

      

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值