我创build了一个专用的deb存储库来传播一个软件,它是600个Ubuntu上网本的更新。 每次连接networking时,我的脚本都会尝试执行apt-get更新。
但有时(事实上经常),我有这样的:
Failed to fetch https://myserver/ubuntu/dists/maverick/main/binary-i386/voosicomat.deb **Size mismatch**
服务器是2.2 Apache,HTTPS只。 它的日志没有错误。
这是脚本:
apt-get update apt-get dist-upgrade --force-yes --yes
这是apt-get的完整输出
Ign https://myserver maverick Release.gpg Ign https://myserver/ubuntu/ maverick/main Translation-en Ign https://myserver maverick Release Ign https://myserver maverick/main i386 Packages/DiffIndex Ign https://myserver maverick/main i386 Packages Ign https://myserver maverick/main i386 Packages Hit https://myserver maverick/main i386 Packages Reading package lists... Reading package lists... Building dependency tree... Reading state information... The following packages will be upgraded: majdb utilitaires voosicomat 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 6207kB/6273kB of archives. After this operation, 0B of additional disk space will be used. WARNING: The following packages cannot be authenticated! utilitaires voosicomat majdb Get:1 https://myserver/ubuntu/ maverick/main voosicomat all 2.0.1 [4755kB] Get:2 https://myserver/ubuntu/ maverick/main majdb all 1.0.17 [1452kB] Failed to fetch https://myserver/ubuntu/dists/maverick/main/binary-i386/voosicomat.deb Size mismatch Fetched 7091kB in 21s (324kB/s) E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
你的问题可能是一个回购bug。 如果索引没有更新回购,那么你会得到(不是很有帮助) Size mismatch
错误。
一个可能的解决办法是更新您的回购
sudo /usr/local/deb/update
你也可以编辑你的apt sources.list来移除除本地之外的所有回购。
非上述答案为我工作。 事实certificate,这个问题涉及到一些代理和HTTP / 1.1stream水线
apt-get -o Debug::Acquire::http=true update
显示了一些疯狂的最后修改头从2012年…我们也有问题,下载的包有不同的内容,我们所期望的,这是非常奇怪的
解决scheme是禁用HTTPstream水线的apt
1)创build一个文件/etc/apt/apt.conf.d/00httppipeline
2)复制粘贴Acquire::http::Pipeline-Depth "0";
3)删除apt cache rm -rf /var/cache/apt/*
之后,大小不匹配或散列大小不匹配错误消失,我可以升级我的包
我正在运行Ubuntu 11并删除了/ var / cache / apt / archives /下的所有* .deb
然后运行:apt-get –fix-install install
似乎工作。
我正在运行初级操作系统:
要删除已经安装(并不再需要)的已下载软件包(.deb)
sudo apt-get clean
要删除所有存储在caching中的档案,以便无法再下载的软件包(因此软件包不再在存储库中或存储库中的版本较新)。
sudo apt-get autoclean
删除不必要的软件包(卸载应用程序后,可能会有不再需要的软件包)
sudo apt-get autoremove
这解决了我的错误。