linux 无法安装Apache 2

jw5wzhpr  于 6个月前  发布在  Linux
关注(0)|答案(9)|浏览(99)

尝试在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.

字符串

ux6nzvsh

ux6nzvsh1#

看起来有些软件包在你的系统中被破坏了,首先修复它们

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

字符串
然后

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


这应该解决你的问题。

h5qlskok

h5qlskok2#

sudo apt-get remove apache* && sudo apt-get install apache2

字符串

3qpi33ja

3qpi33ja3#

运行此命令通常可以解决包的问题:

sudo apt-get update

字符串
这也可能有助于:

sudo apt-get upgrade


请参阅this Linode指南。

aor9mmx1

aor9mmx14#

看起来有些软件包要么坏了,要么需要降级的软件包:对我来说,我只是先清除libaprutil 1软件包,然后用apache 2重新安装它。

sudo apt-get install apache2

字符串
希望它能起作用。

aemubtdh

aemubtdh5#

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

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

   sudo apt-get update

字符串
现在工作:)

z31licg0

z31licg06#

从系统中删除Apache 2

  1. sudo apt-get purge apache2*
    删除apache 2的文件夹和文件
  2. sudo rm -rf /etc/apache2
    Apache2
  3. sudo apt-get安装apache 2
ubbxdtey

ubbxdtey7#

add-apt-repository不是一个软件包,所以你不能使用sudo apt-get install add-apt-repository来安装它。
包含add-apt-repository命令的包是(并且一直是):
第一个月
而不是你可能认为的python-software-properties。你可以使用以下命令检查:
dpkg -S add-apt-repository

r1zhe5dt

r1zhe5dt8#

看起来有些软件包要么坏了,要么需要降级的软件包:对我来说,我只是先清除libaprutil 1软件包,然后用apache2重新安装它。

sudo apt-get update

x

sudo apt-get remove apache* && sudo apt-get install apache2
dpkg --configure -a
sudo apt-get -f install
sudo apt-get install apache2-bin apache2
OR
sudo aptitude install apache2-bin apache2

的数据

5uzkadbs

5uzkadbs9#

当我尝试在一个新系统上安装Apache时,也遇到了类似的错误。我添加了ondrej apache2 PPA,并将sources.list.d文件中的发行版名称从“jammy”改为“lunar”,这就是导致我出现问题的原因。
下面是安装错误:

The following packages have unmet dependencies.
 apache2-bin : Depends: libaprutil1-ldap but it is not going to be installed
               Depends: libldap-2.5-0 (>= 2.5.4) but it is not installable
E: Unable to correct problems, you have held broken packages.

字符串
我删除了ondrej apache2 PPA(必须首先在sources.list.d文件中将发布名称更改回“lunar”),做了一个apt更新,然后一切正常。

相关问题