设置私有 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 /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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到这个问题有一段时间了,它使我们的自动化构建失败,并且谷歌搜索没有给我们带来任何结果。我们发现问题出在我们的网络服务器配置上。我们使用以下方法构建存储库:
然后将存储库目录映射到 nginx 站点。默认的 nginx 设置具有以下配置,这给我们带来了痛苦:
这会将所有文件映射到资源,然后将找不到的任何内容映射到 index.html 页面。因此,当 apt 查找 dist/main/i18n/Index 时,它收到了 HTTP 200,但该文件不是 apt 所期望的,因此出现错误。我们将配置的 try_files 部分替换为:
然后对 */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:
And then we mapped the repository directory to an nginx site. The default nginx setup had the following configuration that was causing us pain:
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:
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.
我刚刚遇到了同样的问题,但是使用的是 Apache。上面的解决方案可以轻松移植到 .htaccess 文件:
I just had the same problem but with Apache. The solution above can easily be ported to a .htaccess file:
也有同样的错误,我通过在 .htaccess 中添加这些行来解决:
Having the same errors too, I had solved by adding theses lines in .htaccess :