屢次在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了。