2014-02-25 100 views
1

我在Debian上安裝apache2時遇到了問題。當我嘗試安裝,我得到Debian apache2未找到

sudo apt-get install apache2 
Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
E: Unable to locate package apache2 

這是我的回購協議(/etc/apt/sources.list

#deb http://debian.mirrors.ovh.net/debian/ wheezy main 
deb-src http://debian.mirrors.ovh.net/debian/ wheezy main 

#deb http://security.debian.org/ wheezy/updates main 
deb-src http://security.debian.org/ wheezy/updates main 
#deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main 
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main 
#deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main 
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main 
deb http://security.ubuntu.com/ubuntu maverick-security main restricted 
deb-src http://security.ubuntu.com/ubuntu maverick-security main restricted 
deb http://security.ubuntu.com/ubuntu maverick-security universe 
deb-src http://security.ubuntu.com/ubuntu maverick-security universe 
deb http://security.ubuntu.com/ubuntu maverick-security multiverse 
deb-src http://security.ubuntu.com/ubuntu maverick-security multiverse 

當我嘗試鍵入apt-cache search apache2它返回null(空行)

+0

你有一個錯誤。它應該是:'apt-cache search apach2'。您也可以使用以下語句篩選結果:apt-cache search apache2 | grep^apache2'(當你確定你正在搜索的軟件包將存在,因爲它是Debian倉庫中的自己的條目)。 – PdC

回答

1

刪除#字符在每一行的開頭。

DEB回購是二進制包

的deb-src的回購是源代碼包

0

正如@nurza說,你必須啓用二進制回購,刪除「#」在與#deb開始行。您在/etc/apt/sources.list中第一行應該有:

deb http://debian.mirrors.ovh.net/debian/ wheezy main 
1

在你的搜索命令來完成這一

sudo apt-get update 

sudo apt-get install apache2 
相關問題