本文主要是介绍解决错误apt --fix-broken install,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
遇到这个问题好几次了,每次都得重新搜索解决方案,索性记录一下吧。
问题:
用apt安装build-essential时,遇到以下报错:
$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.8ubuntu1.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:autoconf : Depends: m4 (>= 1.4.13)automake : Depends: autotools-dev (>= 20020320.1) but it is not going to be installedbison : Depends: m4cmake-doc : Depends: libjs-sphinxdoc (>= 1.0) but it is not going to be installedRecommends: doc-base but it is not going to be installedflex : Depends: m4Recommends: libfl-dev but it is not going to be installedg++-multilib : Depends: g++-9-multilib (>= 9.3.0-3~) but it is not going to be installedgcc-doc : Depends: gcc-9-doc (>= 9.3.0-3~) but it is not going to be installedgcc-multilib : Depends: gcc-9-multilib (>= 9.3.0-3~) but it is not going to be installedlibtool : Depends: autotools-dev but it is not going to be installedRecommends: libltdl-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
大致的意思就是说:要安装的这个包有个第三方依赖,但是这个第三方依赖包不会被安装,导致要安装的这个包也不会被安装。
解决方案
首先,按照命令行的提示,运行:
sudo apt --fix-broken install
这个时候,会让你安装一些依赖包,会提示你是否安装,选择Y。
解决。解决。
再重新安装要安装的包即可。
后记:
几乎每次通过以下方式下载apt的离线安装包及依赖,然后然后离线安装时,都会报这个错误。苦恼。
参考:
[1] 解决错误apt --fix-broken install-CSDN博客
这篇关于解决错误apt --fix-broken install的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!