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

2021/5/14 7:25:34

本文主要是介绍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 解决apt报错 E: Some index files failed to download. They have been ignored, or old ones used inst的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程