sudo apt-get update
返回一些错误:
W:无法获取http:// archive.ubuntu.com/ubuntu/dists/trusty/Release无法在发布文件中find期望条目'restricted / source / Sources'(错误的sources.list条目或格式错误的文件)
W:无法获取http:// archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages哈希值总和不匹配
W:无法抓取http:// archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages哈希值总和不匹配
- /etc/cron.daily/apt:分割错误
- Debian aptitude:确定一个软件包来自哪个版本库?
- 有没有办法使用python apt模块添加ppa?
- 尽pipe在/etc/apt/sources.list中没有sid,Debian仍然从sid抓取软件包
- 为什么不安装mysql-server包创build一个root帐户?
W:无法获取http:// archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-i386/Packages哈希值总和不匹配
W:无法获取http:// archive.ubuntu.com/ubuntu/dists/trusty-security/main/i18n/Translation-en哈希总和不匹配
E:一些索引文件无法下载。 他们被忽略了,或者旧的被使用。
有关信息,我的sources.list是以下内容:
#----------------------------------------------------------# # OFFICIAL UBUNTU REPO # #----------------------------------------------------------# ###### Ubuntu Main Repos deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse ###### Ubuntu Update Repos deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse ###### Ubuntu Partner Repo deb http://archive.canonical.com/ubuntu trusty partner deb-src http://archive.canonical.com/ubuntu trusty partner ###### Ubuntu Extras Repo deb http://extras.ubuntu.com/ubuntu trusty main deb-src http://extras.ubuntu.com/ubuntu trusty main #------------------------------------------------------------------------------# # UNOFFICIAL UBUNTU REPOS # #------------------------------------------------------------------------------# ###### 3rd Party Binary Repos #### MongoDB - http://www.mongodb.org/ ## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
问题可能来自你的/etc/resolv.conf文件,检查你是否有一些nameserver指令,并尝试ping archive.ubuntu.com
这是我的resolv.conf:
domain local search local nameserver 8.8.8.8 nameserver 8.8.4.4
我使用Google的公开DNS( https://developers.google.com/speed/public-dns/ )
然后尝试apt-get更新
它检测到一些文件已经过期或损坏,所以它们是无法使用的。 通过rm -rf /var/lib/apt/lists/*删除caching文件,然后再次尝试apt-get update.
如果问题仍然存在,那么某个caching代理可能仍然保留旧的或破碎的内容。 apt-get update -o Acquire::http::No-Cache=True在这种情况下可能会有所帮助。
试试你的本地/最近的Ubuntu镜像。 我testing了美国DE FR镜子,都失败了。 改变到本地镜像解决了这个问题。
你在代理后面吗? 如果是,那么你必须去/etc/apt/apt.conf文件并修改该文件如下。
Acquire::http::proxy "http://username:password@proxyaddress:portnumber/"; Acquire::https::proxy "https://username:password@proxyaddress:8080/";