Ubuntu 设置专用APT存储库时的索引警告

Ubuntu 设置专用APT存储库时的索引警告,ubuntu,apt,Ubuntu,Apt,我正在设置一个私有APT存储库,用于将应用程序部署到服务器集群。我使用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 /

我正在设置一个私有APT存储库,用于将应用程序部署到服务器集群。我使用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

我需要为此担心吗?如果我这样做了,我该如何修复它?

我有一段时间遇到了这个问题,但它失败了,我们的自动构建失败了,谷歌搜索什么也没有给我们。我们发现问题在于我们的Web服务器配置。我们通过以下方式建立回购协议:

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_文件部分替换为:

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

然后所有对*/i18n/Index的请求都返回了一些HTTP错误代码,然后它就不用费事去解析它们了,问题就消失了。不知道这是否对您有帮助,但它让我们痛苦了2个小时,试图找出我们的deb或repo没有问题,但我们的web服务器有问题。

我也有同样的问题,但Apache有问题。上述解决方案可以轻松移植到.htaccess文件:

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

重新启动发动机
重写规则(.*)$1

同样的错误,我通过在.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>

重新启动发动机
重写基/
##以下规则针对用户代理“Debian APT-HTTP/1.3(0.8.10.3)”进行测试
##由apt get、APTITE和synaptic使用->发送403答案(禁止)。
RewriteCond%{HTTP\u USER\u AGENT}^Debian\APT-HTTP
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^.*-[F,L]

我也遇到了同样的问题,它导致自动厨师安装失败,因此我发现这不仅仅是令人讨厌的问题