Ubuntu 解決:當執行sudo apt-get update
或者sudo apt-get install
命令是出現的 “apt-get 404 Not Found Package Repository Errors” 問題 和 “E: Some index files failed to download They have been ignored, or old ones used” 問題
當你執行sudo apt-get update
命令的時候,如果你遇到下面的問題:
W: The repository 'http://ppa.launchpad.net/ackondro/tibesti/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/ackondro/tibesti/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
或者
W: The repository 'http://ppa.launchpad.net/ackondro/tibesti/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/ackondro/tibesti/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
解決方法
首先,我們將現在出問題的 /etc/apt/sources.list
文件備份一份。(只是一個好習慣而已)
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
注:
/etc/apt/sources.list
文件 里面存放的是 Linux系統需要的軟件源的網站。
接着,我們重新編寫一個 /etc/apt/sources.list
文件:
sudo gedit /etc/apt/sources.list
將下面的模板內容,復制粘貼到 /etc/apt/sources.list
文件里面后,保存就可以了:(我們使用的Ubuntu 是16.04)
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
##測試版源
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源碼
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
##測試版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
如要用於其他版本,把 xenial 換成版本代號就好:
16.04
xenial(模板詳細內容)
15.10
willy(模板詳細內容)
14.04
trusty(模板詳細內容)
12.04
precise(模板詳細內容)
現在,再執行:
sudo apt-get update
現在就沒有“apt-get 404 Not Found Package Repository Errors” 問題了。
小結:
這個問題,解決方法簡單,但是對於初學者來說,卻是一個觸手的問題。
出現這個問題的原因是: 之前 /etc/apt/sources.list
路徑里面的軟件源更新網站有的已經過時了,需要更新新的網站。
Unable to connect to cn.archive.ubuntu.com:http: [112.124.140.210 80]
如果你出現這樣的錯誤,說明你的網斷了,查看網絡連接情況。
參考網站:
How to fix Ubuntu/Debian apt-get 404 Not Found Package Repository Errors (Saucy, Raring, Quantal, Oneiric, Natty…)
https://smyl.es/how-to-fix-ubuntudebian-apt-get-404-not-found-package-repository-errors-saucy-raring-quantal-oneiric-natty/
Ubuntu apt-get unable to fetch packages
http://stackoverflow.com/questions/30316812/ubuntu-apt-get-unable-to-fetch-packages
源列表
http://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8