2014-02-25 62 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 
相关问题