Ubuntu中無法update的解決辦法


我輸入 sudo apt-get update 出現錯誤:

/etc/apt$ sudo apt-get update Err http://security.ubuntu.com precise-security InRelease Err http://security.ubuntu.com precise-security Release.gpg Temporary failure resolving 'security.ubuntu.com' Err http://cn.archive.ubuntu.com precise InRelease Err http://cn.archive.ubuntu.com precise-updates InRelease Err http://cn.archive.ubuntu.com precise-backports InRelease Err http://cn.archive.ubuntu.com precise Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' Err http://cn.archive.ubuntu.com precise-updates Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' Err http://cn.archive.ubuntu.com precise-backports Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/InRelease W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Temporary failure resolving 'security.ubuntu.com' W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. xinju@xinjuOffice:/etc/apt$ cd ../network

(錯誤當時沒有記錄下來上網找到了同樣錯誤的提示!)

——-下面我們就一起討論下這個情況!

所有停止維護的版本都可以使用old源。所以在元列表中把原來的地址改為帶有old源的就可以了。

首先,備份系統中的源列表,打開終端,輸入
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

這里寫圖片描述

4.輸入
sudo gedit /etc/apt/sources.list
打開源列表文件,ctrl+A,然后delete,刪除全部內容
然后把下面的地址復制到該文件中:

deb http://old-releases.ubuntu.com/ubuntu utopic main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu utopic-updates main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu utopic-proposed main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu utopic-backports main restricted universe multiverse deb-src http://old-releases.ubuntu.com/ubuntu utopic main restricted universe multiverse deb-src http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse deb-src http://old-releases.ubuntu.com/ubuntu utopic-updates main restricted universe multiverse deb-src http://old-releases.ubuntu.com/ubuntu utopic-proposed main restricted universe multiverse deb-src http://old-releases.ubuntu.com/ubuntu utopic-backports main restricted universe multiverse

這里寫圖片描述

5.需要注意的是上面地址中的 utopic是ubuntu系統版本的名稱,我的ubuntu系統是14.10,對應的版本名稱是utopic。只要把這里的utopic換車你自己系統版本的名稱即可,如果不知道版本名稱的話,可以運行以下命令獲得
lsb_release -a
其中,Codename就是了。

這里寫圖片描述

6.保存好源列表文件后,進入到終端,一定要再輸入以下命令
sudo apt-get update
來進行更新,會看到沒有失敗的提示了,轉而出現“命中,獲取中”等字眼。
這里寫圖片描述

這里寫圖片描述

本文為轉載,出處為圖片 上的網址。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM