2015-11-03 250 views
4

我無法在Ubuntu 14.04上安裝apache2。無法在Ubuntu上安裝apache2 14.04

上執行

sudo apt-get install apache2,提示以下錯誤: -

The following packages have unmet dependencies: 
apache2 : Depends: apache2-bin (= 2.4.7-1ubuntu4) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

正如link我試圖做apt-get upgrade -f提及。

另外的apt-cache depends apache2輸出的dpkg --get-selections | grep -i ^apache2

apache2      deinstall 
apache2-doc     install 
apache2-utils     install 
apache2.2-common    deinstall 

輸出的apt-mark unhold apache2-bin apache2-bin was already not hold

輸出的

apache2 
    Depends: lsb-base 
    Depends: procps 
    procps:i386 
    Depends: perl 
    Depends: mime-support 
    Depends: apache2-bin 
    Depends: apache2-data 
    Suggests: <www-browser> 
    arora 
    dillo 
    dwb 
    lynx-cur:i386 
    lynx-cur 
    netsurf 
    netsurf-fb 
    netsurf-gtk 
    uzbl 
    chimera2 
    chromium-browser 
    elinks 
    epiphany-browser 
    firefox 
    google-chrome-beta 
    google-chrome-stable 
    google-chrome-unstable 
    konqueror 
    links 
    links2 
    midori 
    netrik 
    rekonq 
    surf 
    w3m:i386 
    w3m 
    xemacs21-mule 
    xemacs21-mule-canna-wnn 
    xemacs21-nomule 
Suggests: apache2-doc 
|Suggests: apache2-suexec-pristine 
    Suggests: apache2-suexec-custom 
    Suggests: ufw 
    Suggests: apache2-utils 
    apache2-utils:i386 
    Recommends: ssl-cert 
    Conflicts: apache2.2-common 
    Conflicts: <apache2.2-common:i386> 
    Replaces: apache2.2-common 
    Replaces: <apache2.2-common:i386> 
    Conflicts: apache2:i386 

apt-cache policy apache2 apache2-bin

輸出
apache2: 
    Installed: (none) 
    Candidate: 2.4.7-1ubuntu4 
    Version table: 
    2.4.16-4+deb.sury.org~precise+4 0 
     100 /var/lib/dpkg/status 
    2.4.7-1ubuntu4 0 
     500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 
apache2-bin: 
    Installed: (none) 
    Candidate: 2.4.7-1ubuntu4 
    Version table: 
    2.4.7-1ubuntu4 0 
     500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 

sudo aptitude -f install apache2

The following NEW packages will be installed: 
    apache2 apache2-bin{a} apache2-data{a} libaprutil1-dbd-sqlite3{ab} libaprutil1-ldap{ab} 
0 packages upgraded, 5 newly installed, 0 to remove and 1 not upgraded. 
Need to get 1,106 kB of archives. After unpacking 4,703 kB will be used. 
The following packages have unmet dependencies: 
libaprutil1-dbd-sqlite3 : Depends: libaprutil1 (= 1.5.3-1) but 1.5.4-1+deb.sury.org~precise+1 is installed. 
libaprutil1-ldap : Depends: libaprutil1 (= 1.5.3-1) but 1.5.4-1+deb.sury.org~precise+1 is installed. 
The following actions will resolve these dependencies: 

    Keep the following packages at their current version: 
1)  apache2 [Not Installed]        
2)  apache2-bin [Not Installed]       
3)  libaprutil1-dbd-sqlite3 [Not Installed]    
4)  libaprutil1-ldap [Not Installed]     



Accept this solution? [Y/n/q/?] Y 
No packages will be installed, upgraded, or removed. 
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded. 
Need to get 0 B of archives. After unpacking 0 B will be used. 

輸出可有一個人幫助了什麼錯誤?

+0

同樣的問題在這裏:( –

回答

1

嘿,我幾個月前有同樣的問題!
試試這個:

apt-get --purge remove apache2 
apt-get autoremove 
rm -rf /etc/apache2/ 
apt-get clean 
apt-get update 

之後,你可以嘗試重新安裝。

我希望這有助於:-)

+0

不工作仍然得到同樣的錯誤'下面的軟件包有不能滿足的依賴關係: 的Apache2:依賴:Apache2的斌(= 2.4.7-1ubuntu4),但它不會安裝 E:無法糾正問題,你已經拿到了破包。 ' – tuk

10

我遇到類似的問題升級Ubuntu的12.04.x與用於先前升級PHP5定製PPA到14.04.x時。

我跟蹤到問題,發現有問題的包是libaprutil1。

我嘗試以下方法,它解決了我的問題

apt-get remove libaprutil1 
apt-get autoremove 
apt-get install apache2 

希望它能幫助!

+0

幫助我很多,謝謝! – jpk

2

我有同樣的問題,我解決了它與這個命令

sudo apt-get -f autoremove 
sudo apt-get update 
sudo apt-get upgrade 
sudo apt-get dist-upgrade 

比再試一次:

sudo apt-get install apache2 
0

當記者問,不接受給定的解決方案,使資質,接下來,提供一個替代方案,它將安裝apache-bin這是錯誤顯示的未滿足依賴項。