E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

问题描述:

多次在apt install时候遇到E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing? 的error。

Error报的信息显示是这个包向source里的资源下载失败了,但是原因是多种多样的,这里做了个总结,以防下次踩坑:

问题解决:

1- source本身的问题

根据提示,我们首先应当 apt-get update 一下source,如果在apt-get update后依然报这个error,那就说明这个source本省就有错误,尝试apt-get update –fix-missing后依旧报这个error,果断换source。

输入命令:

sudo cp sources.list sources.list.bak
就是先将sources.list备份到sources.list.bak

将 /etc/apt/sources.list 的内容换成你自己需要的版本的源

最后sudo apt-get update一下就OK了。

2- 网络的问题

网关错误拦截了数据包或者防火墙故意将其屏蔽在外(比方update 包含有google-chrome浏览器的source时候,ip 会自动重定向至6.6.6.6)

sudo vim /etc/resolv.conf

添加:
nameserver 8.8.8.8
nameserver 223.5.5.5
nameserver 223.6.6.6

或是换网络试一下或者参见该配置代理即可。

最后sudo apt-get update一下就OK了。

YY