ubuntu 解决apt报错 E: Some index files failed to download. They have been ignored, or old ones used inst

网络上的解决方案大致有两个,我都用了,最后问题解决了。不太清楚是那个方法解决问题的。

方法一:修改DNS服务器

vim /etc/resolv.conf 

然后添加:

nameserver 8.8.8.8
nameserver 8.8.4.4

阿里源的再添加:

nameserver 223.5.5.5  
nameserver 223.6.6.6

最后运行

apt-get update

可能会有一些找不到,先别管,然后接着再apt-get install下载文件实施。

如果不行,尝试方法二。

方法二:更换apt源

vim /etc/apt/sources.list

可以把之前的都注释调,然后添加:

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner

保存关闭。

apt-get update

然后再下载试试。

上一篇:Ubuntu 更换国内源


下一篇:Ubuntu更新源