![我怎样才能摆脱 ubuntu 14.04 桌面中的“apache2:依赖:perl 但是它不会被安装”?](https://linux22.com/image/690365/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E6%91%86%E8%84%B1%20ubuntu%2014.04%20%E6%A1%8C%E9%9D%A2%E4%B8%AD%E7%9A%84%E2%80%9Capache2%EF%BC%9A%E4%BE%9D%E8%B5%96%EF%BC%9Aperl%20%E4%BD%86%E6%98%AF%E5%AE%83%E4%B8%8D%E4%BC%9A%E8%A2%AB%E5%AE%89%E8%A3%85%E2%80%9D%EF%BC%9F.png)
这是我运行时控制台上出现的错误消息
$sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
apache2 : Depends: perl but it is not going to be installed
Depends: apache2-bin (= 2.4.7-1ubuntu4) but it is not going to be installed
Depends: apache2-data (= 2.4.7-1ubuntu4) but 2.4.7-1ubuntu4.13 is to be installed
E: Unable to correct problems, you have held broken packages.
更新输出
$sudo apt-get update
Hit http://ppa.launchpad.net trusty InRelease
Ign http://in.archive.ubuntu.com trusty InRelease
Hit http://in.archive.ubuntu.com trusty Release.gpg
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty Release
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Hit http://in.archive.ubuntu.com trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty/main i386 Packages
Hit http://in.archive.ubuntu.com trusty/main Translation-en
Ign http://in.archive.ubuntu.com trusty/main Translation-en_IN
Reading package lists... Done
我最近做过
sudo rm -rf /var/lib/apt/lists/*
sudo rm /etc/apt/sources.list
后来我去了
sudo -i software-properties-gtk
然后选中规范复选框,
sudo apt-get update 我执行的这个命令。
谁能帮我在我的 ubuntu 上安装 apache!
答案1
这通常发生在您在 apt 中混合使用不同的存储库时。有时来自不同存储库的依赖项不匹配,您就会遇到这种情况。添加 ppa 存储库时,最好确保您添加的是与您的 ubuntu 版本兼容的正确存储库。混合不同 ubuntu 版本甚至不同发行版(如 debian/mint)的存储库可能会有效,但总有可能出现问题。
查看 ask ubuntu 上的这个答案 https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies-after-adding-a-ppa