參考:ubuntu: apt-get update的時候遇到“Hash Sum mismatch”錯誤
在安裝Mininet的時候,apt-get update的時候遇到了這個問題:
W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/trusty/main/binary-i386/Packages Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.
這個問題總結就是:“總的來說就是提供源的服務器的問題。”
解決方法有三種:
1.清除之前的緩存,重新apt-get update
sudo apt-get clean
sudo apt-get update --fix-missing
2.system settings => 換源
3./var/lib/apt/lists
sudo rm -fR /var/lib/apt/lists/*
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get update
講道理,一般來說到這里應該已經解決了,但是我依然哈希值不匹配...
在百度無果之后,轉投谷歌,終於在Ubuntu forums中找到了答案,鏈接:關於引起更新源索引時Hash Sum mismatch問題的真正原因及解決方案
原因:
This is a known issue, and is exacerbated for clients behind proxy caches. Some large organisations and ISPs (especially in remote parts of the world) have transparent caches of which you may not be aware.
The fundamental issue is that the apt repository format is subject to race conditions when a mirror is updated. This problem particularly affects repositories that change rapidly, such as the development release.
You can track progress on the fix for this in this bug (please mark yourself as "affects me too" in the bug) and this blueprint. But be aware that it is a complex issue and may take more than one release to resolve.
shareimprove this answer
answered Jul 5 '12 at 22:21
中文翻譯,來自上面鏈接:
你所使用的網絡供應商,有些會設置一些透明緩存,以增加網絡內部速度,減少出口的流量,你獲取的某些文件不是源服務器上的真正文件,是從緩存中獲取的,當緩存中獲取的一些校驗信息跟源中不一致的時候,自然提示校驗失敗,無法繼續更新.
此問題實際上跟apt軟件倉庫的格式設計有關。新發布的版本的軟件倉庫更新比較頻繁,按道理緩存中的文件應該同步更新,可惜因為多個鏡像站點的有快慢,因此造成了緩存無法保證一致性。
當網絡提供商足夠有實力,不設至透明緩存時,這個問題是不存在的。這就是為什么有些人反饋使用無線上網卡(移動、聯通的3g網絡)就一切OK,一單換回長城寬帶、或者寬帶通就不行了。
我使用的解決方法很簡單:開熱點,不使用宿舍的wifi環境,直接繞開透明緩存。
2017/1/3 1/4更新
2/17更新:
今天又遇到了這個情況,不過不一樣的是,我使用的是PC端,而且沒有裝wifi網卡,故無法使用上述辦法。
但是使用上述的方法2換了個源,就解決了。
system settings => 換源