学校架设了缓存服务器,好处不用多说,偶尔也会带来些烦恼。
像Ubuntu这种成天没事就更新源的,缓存服务器经常存取未更新的source文件,造成更新源时提示类似:
Hit http://mirrors.163.com precise-proposed/restricted Translation-en
Hit http://mirrors.163.com
precise-proposed/universe Translation-en
Fetched 16.8 MB in 2min 21s (119 kB/s)
W: Failed to fetch
bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_source_Sources
Hash Sum mismatch
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages Hash Sum mismatch
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages Hash Sum mismatch
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise_restricted_source_Sources Hash Sum mismatch
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise-updates_main_binary-i386_Packages Hash Sum mismatch
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise-proposed_universe_binary-amd64_Packages Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.
这种尴尬的局面,可以通过使用goagent代理来解决。
1. 开启goagent代理,见:
Linux下使用goagent.
2. 另外开启一个终端,更新源:
执行命令: sudo apt-get -o Acquire::http::proxy="http://127.0.0.1:8087/" update
3. OK!