1. 程式人生 > >ubuntu 軟體源無法更新的問題

ubuntu 軟體源無法更新的問題

我使用的ubuntu版本是14.10,屬於非LTS(長期支援版本),因此前一段時間還可以使用apt-get update來更新源,現在已提示更新失敗,無法下載,無法訪問了。現提供一種解決思路供大家參考。如網友有其他有效方法,可以一塊討論。
1、Ubutun版本的更新比較快,目前只有10.04,12.04,14.04,以及後續的16.04會支援長期維護,時間長達3-5年,而其他常規版本的維護期比較短,基本是一年以內。而筆者使用的14.10,已經停止更新了好一段時間,因為平時用的還可以,所以也就沒怎麼更新,直到今天要安裝一些東西了,才發現update不能用了。
2、在網上找了很多Ubuntu14.10對應的源的列表,然後把它們加入到了系統的源列表中,可還是不行。但是,所有停止維護的版本都可以使用old源。所以在元列表中把原來的地址改為帶有old源的就可以了。
3、首先,備份系統中的源列表,開啟終端,輸入: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 ,來進行更新,會看到沒有失敗的提示了,轉而出現“命中,獲取中”等字眼