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。html

  Error报的信息显示是这个包向source里的资源下载失败了,可是缘由是多种多样的,这里作了个总结,以防下次踩坑:chrome

  

  ······ubuntu

  

问题解决:

  1- source自己的问题vim

  根据提示,咱们首先应当 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.bakfetch

  将 /etc/apt/sources.list 的内容换成:
google

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

spa

  更多源请参考:http://www.javashuo.com/article/p-gwyaawng-bc.html.net

  最后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了。

相关文章
相关标签/搜索