ubuntu换源时出现问题的解决
ubuntu换源时出现问题的解决
源自(http://www.wmzblog.cn/post/82.html)
在安装Ubuntu软件的时候总是提示
W: 未能取回 http://cn.archive.ubuntu.com/ubuntu/pool/main/u/unixodbc/unixodbc_2.2.11-16build1_amd64.deb
无法解析域名“cn.archive.ubuntu.com”
到群上去问了下才知道是源的问题,然后就到GG找教程,想把那个没用的源给换了,找到了个不错的教程!比较适合我这样的菜鸟,呵呵!
修改源並更新你的(k/x/ed)ubuntu
* 不同的網路狀況連接以下源的速度不同。建議在添加前手動驗證以下源的連接速度(ping下就行)。比如說北京網通用戶連接cn99就非常慢,而 ftp.sjtu.edu.cn是相對較快的源。選擇最快的源可大大節省下載時間,請根據自己網路環境設置更新伺服器,以達到最快的速度。
* 註意,你可以同時加入幾個源。儘量選擇一組官方的源(也就是下麵的Archive.ubuntu.com的條目)直接加在文件的最後,以避免非官方源軟體 包不全時出現 404 Not Found 文件未發現的錯誤。建議電信用戶使用cn99和臺灣大學的源,網通用戶使用歐洲官方源或臺灣大學的源,教育網用戶使用教育網的源。
打開終端方法:
按下ALT+F2 -> gnome-terminal -> 運行 #(ed)ubuntu
按下ALT+F2 -> konsole -> 運行 #Kubuntu
按下ALT+F2 -> xfce4-terminal -> 運行 #xubuntu
在終端執行命令
備份當前的源列表,以便日後需要時恢復:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
編輯源列表
Ubuntu 和 Edubuntu 中執行:
gksu gedit /etc/apt/sources.list
Kubuntu 中執行:
kdesu kate /etc/apt/sources.list
Xubuntu 中執行:
gksu mousepad /etc/apt/sources.list
適用於所有版本:
sudo vim /etc/apt/sources.list
從以下各伺服器列表內容中選擇一段替換文件中的所有內容,一般來說加入一至兩組即可,加多了影響更新速度。為防止非官方源中軟體包不全的問題,請在sources.list文件中尾部添加一組官方源。
Archive.ubuntu.com更新伺服器(歐洲,此為官方源,電信網通用戶使用):
deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
Ubuntu.cn99.com更新伺服器(江蘇省常州市電信,推薦電信用戶使用):
deb http://ubuntu.cn99.com/ubuntu/ gutsy main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ gutsy main restricted universe multiverse
Mirrors.shlug.org更新伺服器(電信伺服器,Ubuntu China Official Mirror, maintained by Shanghai Linux User Group):
deb http://cn.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
Mirror.lupaworld.com更新伺服器(浙江省杭州市雙線伺服器):
deb http://mirror.lupaworld.com/ubuntu gutsy main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-proposed main restricted universe multiverse
廈門大學更新伺服器(教育網伺服器):
deb ftp://ubuntu.realss.cn/ubuntu/ gutsy main restricted universe multiverse
deb ftp://ubuntu.realss.cn/ubuntu/ gutsy-backports restricted universe multiverse
deb ftp://ubuntu.realss.cn/ubuntu/ gutsy-proposed main restricted universe multiverse
deb ftp://ubuntu.realss.cn/ubuntu/ gutsy-security main restricted universe multiverse
deb ftp://ubuntu.realss.cn/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src ftp://ubuntu.realss.cn/ubuntu/ gutsy main restricted universe multiverse
deb-src ftp://ubuntu.realss.cn/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src ftp://ubuntu.realss.cn/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src ftp://ubuntu.realss.cn/ubuntu/ gutsy-security main restricted universe multiverse
deb-src ftp://ubuntu.realss.cn/ubuntu/ gutsy-updates main restricted universe multiverse
成都市 電子科技大學更新伺服器(教育網,推薦校園網和網通用戶使用):
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy main multiverse restricted universe
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-backports main multiverse restricted universe
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-proposed main multiverse restricted universe
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-security main multiverse restricted universe
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-updates main multiverse restricted universe
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy main multiverse restricted universe
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-backports main multiverse restricted universe
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-security main multiverse restricted universe
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-updates main multiverse restricted universe
== 如果無法解析uestc.edu.cn功能變數名稱,請使用以下地址 ==
deb http://ubuntu.dormforce.net/ubuntu/ gutsy main multiverse restricted universe
deb http://ubuntu.dormforce.net/ubuntu/ gutsy-backports main multiverse restricted universe
deb http://ubuntu.dormforce.net/ubuntu/ gutsy-proposed main multiverse restricted universe
deb http://ubuntu.dormforce.net/ubuntu/ gutsy-security main multiverse restricted universe
deb http://ubuntu.dormforce.net/ubuntu/ gutsy-updates main multiverse restricted universe
deb-src http://ubuntu.dormforce.net/ubuntu/ gutsy main multiverse restricted universe
deb-src http://ubuntu.dormforce.net/ubuntu/ gutsy-backports main multiverse restricted universe
deb-src http://ubuntu.dormforce.net/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://ubuntu.dormforce.net/ubuntu/ gutsy-security main multiverse restricted universe
deb-src http://ubuntu.dormforce.net/ubuntu/ gutsy-updates main multiverse restricted universe
上海市上海交通大學更新伺服器(教育網,推薦校園網和網通用戶使用):
deb http://ftp.sjtu.edu.cn/ubuntu/ gutsy main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ gutsy-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ gutsy-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ gutsy-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ gutsy-updates main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ gutsy main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ gutsy-backports main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ gutsy-security main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ gutsy-updates main multiverse restricted universe
中國科學技術大學更新伺服器(教育網,推薦校園網和網通用戶使用):
deb http://debian.ustc.edu.cn/ubuntu/ gutsy main multiverse restricted universe
deb http://debian.ustc.edu.cn/ubuntu/ gutsy-backports main multiverse restricted universe
deb http://debian.ustc.edu.cn/ubuntu/ gutsy-proposed main multiverse restricted universe
deb http://debian.ustc.edu.cn/ubuntu/ gutsy-security main multiverse restricted universe
deb http://debian.ustc.edu.cn/ubuntu/ gutsy-updates main multiverse restricted universe
deb-src http://debian.ustc.edu.cn/ubuntu/ gutsy main multiverse restricted universe
deb-src http://debian.ustc.edu.cn/ubuntu/ gutsy-backports main multiverse restricted universe
deb-src http://debian.ustc.edu.cn/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://debian.ustc.edu.cn/ubuntu/ gutsy-security main multiverse restricted universe
deb-src http://debian.ustc.edu.cn/ubuntu/ gutsy-updates main multiverse restricted universe
北京市清華大學更新伺服器(教育網,推薦校園網和網通用戶使用):
deb http://mirror9.net9.org/ubuntu/ gutsy main multiverse restricted universe
deb http://mirror9.net9.org/ubuntu/ gutsy-backports main multiverse restricted universe
deb http://mirror9.net9.org/ubuntu/ gutsy-proposed main multiverse restricted universe
deb http://mirror9.net9.org/ubuntu/ gutsy-security main multiverse restricted universe
deb http://mirror9.net9.org/ubuntu/ gutsy-updates main multiverse restricted universe
deb-src http://mirror9.net9.org/ubuntu/ gutsy main multiverse restricted universe
deb-src http://mirror9.net9.org/ubuntu/ gutsy-backports main multiverse restricted universe
deb-src http://mirror9.net9.org/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://mirror9.net9.org/ubuntu/ gutsy-security main multiverse restricted universe
deb-src http://mirror9.net9.org/ubuntu/ gutsy-updates main multiverse restricted universe
沈陽市東北大學更新伺服器(教育網,推薦校園網和網通用戶使用):
deb ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy main multiverse restricted universe
deb ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-backports main multiverse restricted universe
deb ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-proposed main multiverse restricted universe
deb ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-security main multiverse restricted universe
deb ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-updates main multiverse restricted universe
deb-src ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy main multiverse restricted universe
deb-src ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-backports main multiverse restricted universe
deb-src ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-security main multiverse restricted universe
deb-src ftp://ftp.neu.edu.cn/mirror/archive.ubuntu.com/ubuntu/ gutsy-updates main multiverse restricted universe
中國臺灣 臺灣大學更新伺服器(推薦網通用戶使用,電信PING平均響應速度41MS。強烈推薦此源,比較完整,較少出現同步問題):
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-security main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ gutsy-proposed main restricted universe multiverse
Mirror.vmmatrix.net更新伺服器(上海市電信,推薦電信網通用戶使用):
deb http://mirror.vmmatrix.net/ubuntu/ gutsy main restricted universe multiverse
deb-src http://mirror.vmmatrix.net/ubuntu/ gutsy main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://mirror.vmmatrix.net/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://mirror.vmmatrix.net/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://mirror.vmmatrix.net/ubuntu/ gutsy-security main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://mirror.vmmatrix.net/ubuntu/ gutsy-proposed main restricted universe multiverse
ubuntu.cnsite.org更新伺服器(福建省福州市 電信):
deb http://ubuntu.cnsite.org/ubuntu/ gutsy main restricted universe multiverse
deb-src http://ubuntu.cnsite.org/ubuntu/ gutsy main restricted universe multiverse
deb http://ubuntu.cnsite.org/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://ubuntu.cnsite.org/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://ubuntu.cnsite.org/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://ubuntu.cnsite.org/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://ubuntu.cnsite.org/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://ubuntu.cnsite.org/ubuntu/ gutsy-security main restricted universe multiverse
deb http://ubuntu.cnsite.org/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://ubuntu.cnsite.org/ubuntu/ gutsy-proposed main restricted universe multiverse
mirror.rootguide.org更新伺服器(上海市 電信):
deb http://mirror.rootguide.org/ubuntu/ gutsy main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ gutsy main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ gutsy-security main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ gutsy-proposed main multiverse restricted universe
deb-src http://mirror.rootguide.org/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu-cn/ gutsy main restricted universe multiverse
臺灣的官方源速度也相當不錯,有時甚至快於內地的:
deb http://tw.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
Ubuntu-cn,推薦各位中文用戶添加:
deb http://archive.ubuntu.org.cn/ubuntu-cn/ gutsy main restricted universe multiverse
保存編輯好的文件,執行以下命令更新
sudo apt-get update #這一步是更新你的源列表,換源後必須執行
sudo apt-get dist-upgrade #這一步是更新軟體,如果你對新版本軟體的需求不是那麼迫切,可以不執行