【问题标题】:Unable to install Apache2无法安装 Apache2
【发布时间】:2015-10-08 11:29:52
【问题描述】:

尝试在 ubuntu 14.04 上安装 apache2,但出现以下错误

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: apache2-bin (= 2.4.7-1ubuntu4.6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

【问题讨论】:

标签: linux ubuntu apache2.2


【解决方案1】:

您的系统中的某些软件包似乎已损坏,请先修复它们

dpkg --configure -a
sudo apt-get -f install

然后

sudo apt-get install apache2-bin apache2
OR
sudo aptitude install apache2-bin apache2 

这应该可以解决您的问题。

【讨论】:

  • SHOWS : - 以下软件包具有未满足的依赖关系: apa​​che2-bin :依赖于:libapr1 (>= 1.5.0) 但它不可安装 依赖于:libaprutil1 (>= 1.5.0) 但它是无法安装取决于:libaprutil1-dbd-sqlite3 但无法安装或取决于:libaprutil1-ldap 但无法安装 E:无法纠正问题,您持有损坏的软件包。
  • 能否尝试通过执行apt-get autoremove 删除不必要的包,然后再次尝试安装apache。如果这对 aptitude 没有帮助。
  • 试过但没有帮助!
【解决方案2】:
sudo apt-get remove apache* && sudo apt-get install apache2

【讨论】:

    【解决方案3】:

    看起来有些软件包已损坏或需要降级的软件包: 对我来说,我只是先清除 libaprutil1 包,然后使用 apache2 重新安装它。

    sudo apt-get install apache2
    

    那就是它希望它有效。

    【讨论】:

      【解决方案4】:

      从系统中删除 Apache2

      1. sudo apt-get purge apache2*

      删除apache2的文件夹和文件

      1. sudo rm -rf /etc/apache2

      重新安装 Apache2

      1. sudo apt-get install apache2

      【讨论】:

        【解决方案5】:

        运行这个通常可以解决包的问题:

        sudo apt-get update
        

        这也可能有帮助:

        sudo apt-get upgrade
        

        请参阅this Linode 指南。

        【讨论】:

          【解决方案6】:

          通过以下两个步骤解决了这个问题..

             sudo echo "deb http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse" > /etc/apt/sources.list
          
             sudo apt-get update
          

          现在工作:)

          【讨论】:

            【解决方案7】:

            add-apt-repository 不是一个包,所以你不能使用 sudo apt-get install add-apt-repository 安装它。

            包含 add-apt-repository 命令的包是(并且一直是):

            software-properties-common

            不是你想象的 python-software-properties。您可以使用以下命令进行检查:

            dpkg -S add-apt-repository

            【讨论】:

              猜你喜欢
              • 2023-03-27
              • 1970-01-01
              • 1970-01-01
              • 2016-12-01
              • 2016-12-22
              • 1970-01-01
              • 2022-06-21
              • 2023-03-08
              • 1970-01-01
              相关资源
              最近更新 更多