我的 apt-get 完全损坏了,无法安装任何东西。 “apt-get install -f”的输出如下:
# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
gnome-icon-theme : Depends: gtk-update-icon-cache
python3-cairo : Depends: python3 (>= 3.6~) but 3.4.3-1 is installed
python3-gdbm : Depends: python3 (>= 3.6) but 3.4.3-1 is installed
python3-reportlab-accel : Depends: python3 (>= 3.6~) but 3.4.3-1 is installed
rhythmbox : Depends: rhythmbox-data (= 3.1-1ubuntu3) but 3.4.1-2ubuntu5 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
“sudo apt install python3”的输出如图:https://imgur.com/a/IbGK0
我用谷歌搜索了任何可能的问题,并尝试了任何可能的解决方案,但没有人解决它。
转到 /var/log/dist-upgrade/apt.log 并识别损坏的软件包。 “apt-get remove”软件包,进行发布升级,然后您应该能够重新安装它们。
您可以在这里找到更多信息:https://askubuntu.com/questions/124845/eerror-pkgproblemresolverresolve- generated-breaks-this-may-be-caused-by-hel
此命令解决了我的错误
sudo apt -f install
就我而言,我位于代理后面,因此我需要运行以下命令:
sudo nano /etc/apt/apt.conf
并添加了以下几行:
Acquire::http::proxy "http://<user>:<password>@<proxy_host>:<proxy_port>/";
Acquire::https::proxy "https://<user>:<password>@<proxy_host>:<proxy_port>/";
Acquire::ftp::proxy "ftp://<user>:<password>@<proxy_host>:<proxy_port>/";
如果您在 AWS 上使用 EC2,请将
apt-get
替换为 yum
例子:
而不是 apt-get update;
运行这个 yum update;