设置私有 APT 存储库时出现索引警告

发布于 2024-12-19 17:22:12 字数 566 浏览 4 评论 0原文

我正在设置一个私有 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

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

I'm setting up a private APT repository for application deployment to a cluster of servers. I have set up the repository with reprepro essentially following the instructions here, but using a pre-generated GPG key.

However, I keep getting this error when running apt-get update on the target servers:

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

Do I need to worry about this? How do I fix it if I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

怼怹恏 2024-12-26 17:22:12

我遇到这个问题有一段时间了,它使我们的自动化构建失败,并且谷歌搜索没有给我们带来任何结果。我们发现问题出在我们的网络服务器配置上。我们使用以下方法构建存储库:

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 或我们的存储库没有问题,而是我们的网络服务器有问题。

I was getting this issue for a while and it was failing our autmated build and googling around gave us nothing. What we discovered was that issue was with our webserver configuration. We build the repo using:

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

And then we mapped the repository directory to an nginx site. The default nginx setup had the following configuration that was causing us pain:

try_files $uri $uri/ index.html;

This was mapping all files to resources and then anything that it didn't find was mapped to the index.html page. So when apt was looking for dist/main/i18n/Index it was receiving an HTTP 200 but the file was not what apt was expecting, hence the error. We replaced the try_files portion of the config with:

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

And then all requests to */i18n/Index were returning some HTTP error code and then it didn't bother trying to parse them and the issue went away. Don't know if this helps you but it caused us 2 hrs of pain trying to figure out that we didn't have an issue with our debs or our repo but our webserver.

情栀口红 2024-12-26 17:22:12

我刚刚遇到了同样的问题,但是使用的是 Apache。上面的解决方案可以轻松移植到 .htaccess 文件:

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

I just had the same problem but with Apache. The solution above can easily be ported to a .htaccess file:

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule (.*) $1
</IfModule>
橪书 2024-12-26 17:22:12

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

Having the same errors too, I had solved by adding theses lines in .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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文