【问题标题】:Debian apache2 not found找不到 Debian apache2
【发布时间】:2014-02-25 14:10:02
【问题描述】:

我在 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(空行)

【问题讨论】:

  • 您的搜索命令有误。应该是:apt-cache search apach2。您可能还想过滤结果:apt-cache search apache2 | grep ^apache2(当您相当确定您正在搜索的软件包将作为它自己的条目存在于 Debian 存储库中时很有用。)

标签: apache2 debian


【解决方案1】:

这样做

sudo apt-get update

sudo apt-get install apache2

【讨论】:

    【解决方案2】:

    删除每行开头的#字符。

    deb repo 用于二进制包

    deb-src repo 用于源包

    【讨论】:

      【解决方案3】:

      正如@nurza 所说,您必须启用二进制存储库,删除以#deb 开头的行上的“#”。您在 /etc/apt/sources.list 上的第一行应该有:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-09-11
        • 2015-08-08
        • 2014-05-12
        • 1970-01-01
        • 1970-01-01
        • 2018-11-03
        • 1970-01-01
        • 2018-12-02
        相关资源
        最近更新 更多