apt-get update更新源时,出现“Hash Sum mismatch”问题

简介:

 

当使用apt-get update更新源时,出现下面“Hash Sum mismatch”的报错,具体如下:
root@localhost:~# apt-get update
......
......
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/binary-i386/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/binary-i386/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/binary-i386/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/binary-i386/Packages Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

 

产生原因:
所使用的网络供应商,有些会设置一些透明缓存,以增加网络内部速度,减少出口的流量,所获取的某些文件不是源服务器上的真正文件,是从缓存中获取的,当缓存中获取的一些校验信息跟源中不一致的时候,自然提示校验失败,无法继续更新。


解决办法:
1)删掉/var/lib/apt/lists 这个目录下的东西
sudo rm -fR /var/lib/apt/lists/* 
2)新建相应文件夹 
sudo mkdir /var/lib/apt/lists/partial 
3)重新update 
sudo apt-get update

 

***************当你发现自己的才华撑不起野心时,就请安静下来学习吧***************
本文转自散尽浮华博客园博客,原文链接:http://www.cnblogs.com/kevingrace/p/6083854.html ,如需转载请自行联系原作者
相关文章
|
22天前
|
Ubuntu Docker 容器
sudo apt-get update失败已经解决 报错 The update command takes no arguments
sudo apt-get update失败已经解决 报错 The update command takes no arguments
28 0
|
Linux
Linux - Centos 8 执行 yum makecache fast 报错:yum makecache: error: argument timer: invalid choice: 'fast' (choose from 'timer')
Linux - Centos 8 执行 yum makecache fast 报错:yum makecache: error: argument timer: invalid choice: 'fast' (choose from 'timer')
652 0
|
4月前
|
算法 安全 C++
【C++14算法】make_unique
【C++14算法】make_unique
|
12月前
|
Python
解决"easy_install command not found"问题记录
解决"easy_install command not found"问题记录
448 0
|
Ubuntu 开发工具 git
apt install git:Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git-man_2.17.1-1ubuntu0.11_all.deb 404 Not Found [IP: 91.189.91.39 80]
281 0
apt install git:Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
apt-get update时卡在 [0%]waiting for headers
apt-get update时卡在 [0%]waiting for headers
|
Ubuntu 网络安全 开发工具
Ubuntu E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 错误
Ubuntu E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 错误
664 0
|
SQL Java 程序员
记录:1221 - Incorrect usage of UNION and ORDER BY...【亲测有效】
记录:1221 - Incorrect usage of UNION and ORDER BY...【亲测有效】
368 0
|
关系型数据库 MySQL
You can remove cached packages by executing ‘yum clean packages‘. Error: GPG check FAILED
我们在使用服务器时安装mysql遇到的问题,现将有效的解决方案列出来 原因是:GPG对于包的源key的验证没有通过
You can remove cached packages by executing ‘yum clean packages‘. Error: GPG check FAILED