天天看点

debian apt-get install软件包错误

在debian8中使用apt-get install安装软件包时发生错误,具体错误如下

~# apt-get install minicom
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gnupg : Depends: gnupg-utils (< 2.2.12-1+deb10u1.1~) but it is not going to be installed
         Depends: gnupg-utils (>= 2.2.12-1+deb10u1) but it is not going to be installed
         Depends: gpg (< 2.2.12-1+deb10u1.1~) but it is not going to be installed
         Depends: gpg (>= 2.2.12-1+deb10u1) but it is not going to be installed
         Depends: gpg-agent (< 2.2.12-1+deb10u1.1~) but it is not going to be installed
         Depends: gpg-agent (>= 2.2.12-1+deb10u1) but it is not going to be installed
         Depends: gpg-wks-client (< 2.2.12-1+deb10u1.1~) but it is not going to be installed
         Depends: gpg-wks-client (>= 2.2.12-1+deb10u1) but it is not going to be installed
         Depends: gpg-wks-server (< 2.2.12-1+deb10u1.1~) but it is not going to be installed
         Depends: gpg-wks-server (>= 2.2.12-1+deb10u1) but it is not going to be installed
         Depends: gpgsm (< 2.2.12-1+deb10u1.1~) but it is not going to be installed
         Depends: gpgsm (>= 2.2.12-1+deb10u1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
           

分析下来出现“you might want to run 'apt-get -f install' to correct these”这个错误主要是之前安装其他软件包时异常中断退出所造成的,网上查找资料最后的到解决方案,输入如下命令修复安装包

$ sudo apt-get --fix-broken install
           

或者使用命令

$ sudo dpkg --purge xxx
           

其中xxx为安装失败的程序,错误提示中会给出其名称,不过也有可能是错误提示中未给出的,但之前安装出错的程序。

参考文章链接https://www.jianshu.com/p/110206657688

继续阅读