简体   繁体   English

找不到Debian apache2

[英]Debian apache2 not found

I have a problem with installing apache2 on Debian. 我在Debian上安装apache2时遇到问题。 When I try to install I get 当我尝试安装时,我得到

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

This is my repo ( /etc/apt/sources.list ) 这是我的仓库( /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

And when I try to type apt-cache search apache2 it return null(empty line) 当我尝试键入apt-cache search apache2它返回null(空行)

Remove the # character at the beginning of each line. 删除每行开头的#字符。

deb repo are for binary packages deb repo用于二进制软件包

deb-src repo are for source packages deb-src repo用于源软件包

do this 做这个

sudo apt-get update

sudo apt-get install apache2

As @nurza said, you have to enable binary repos, erase the "#" on lines that begins with #deb. 正如@nurza所说,您必须启用二进制存储库,在以#deb开头的行上删除“#”。 Your first line on /etc/apt/sources.list should have: /etc/apt/sources.list上的第一行应包含:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM