【问题标题】:Index warning when setting up private APT repository设置私有 APT 存储库时的索引警告
【发布时间】:2013-10-24 07:58:02
【问题描述】:

我正在设置一个私有 APT 存储库,用于将应用程序部署到服务器集群。我基本上按照here 的说明使用 reprepro 设置了存储库,但使用的是预先生成的 GPG 密钥。

但是,在目标服务器上运行 apt-get update 时,我不断收到此错误:

W: Failed to fetch http://domU-xx-xx-xx-xx-xx-xx.compute-1.internal/aptrepo/dists/oneiric/non-free/i18n/Index
No Hash entry in Release file /var/lib/apt/lists/partial/domU-xx-xx-xx-xx-xx-xx.compute-1.internal_aptrepo_dists_oneiric_non-free_i18n_Index

我需要担心这个吗?如果我这样做了,我该如何解决?

【问题讨论】:

  • 我遇到了同样的问题,它导致自动厨师安装失败,所以我发现它不仅仅是烦人

标签: ubuntu apt


【解决方案1】:

我遇到这个问题有一段时间了,我们的自动化构建失败了,谷歌搜索什么也没给我们。我们发现问题出在我们的网络服务器配置上。我们使用以下方式构建存储库:

reprepro -V --ignore=wrongdistribution -b repository include precise <some-package.changes>

然后我们将存储库目录映射到一个 nginx 站点。默认的 nginx 设置有以下配置,这让我们很痛苦:

try_files $uri $uri/ index.html;

这是将所有文件映射到资源,然后将未找到的任何内容映射到 index.html 页面。因此,当 apt 正在寻找 dist/main/i18n/Index 时,它收到了 HTTP 200,但该文件不是 apt 所期望的,因此出现了错误。我们将配置的 try_files 部分替换为:

server {
    ...
    location / {
        ...
        try_files $uri $uri/; # index.html;
        ...
    }
    ...
}

然后对 */i18n/Index 的所有请求都返回了一些 HTTP 错误代码,然后它就没有费心尝试解析它们,问题就消失了。不知道这是否对您有帮助,但它让我们痛苦了 2 小时,试图弄清楚我们的 debs 或我们的 repo 没有问题,而是我们的网络服务器有问题。

【讨论】:

    【解决方案2】:

    我只是遇到了同样的问题,但使用的是 Apache。上面的解决方案可以很容易地移植到 .htaccess 文件中:

    <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteRule (.*) $1
    </IfModule>
    

    【讨论】:

      【解决方案3】:

      也有同样的错误,我已经通过在 .htaccess 中添加这些行来解决:

      <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        ## Folowing rule is tested for user-agent 'Debian APT-HTTP/1.3 (0.8.10.3)'
        ## used by apt-get, aptitude and synaptic -> send a 403 answer (Forbidden).
        RewriteCond %{HTTP_USER_AGENT} ^Debian\ APT-HTTP
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^.* - [F,L]
      </IfModule>
      

      【讨论】:

        猜你喜欢
        • 2018-11-30
        • 2023-03-24
        • 2014-04-06
        • 1970-01-01
        • 2016-06-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-19
        相关资源
        最近更新 更多