首先,我们将现在出问题的 /etc/apt/sources.list
文件备份一份。(只是一个好习惯而已)
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
接着,我们重新编写一个 /etc/apt/sources.list
文件:
sudo gedit /etc/apt/sources.list
将下面的模板内容,复制粘贴到 /etc/apt/sources.list
文件里面后,保存就可以了:
如要用于其他版本,把 xenial 换成版本代号就好:
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 # Canonical 合作夥伴和附加 deb http://archive.canonical.com/ubuntu/ xenial partner deb http://extras.ubuntu.com/ubuntu/ xenial main
15.10
deb http://cn.archive.ubuntu.com/ubuntu/ wily main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse ##測試版源 deb http://cn.archive.ubuntu.com/ubuntu/ wily-proposed main restricted universe multiverse # 源碼 deb-src http://cn.archive.ubuntu.com/ubuntu/ wily main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse ##測試版源 deb-src http://cn.archive.ubuntu.com/ubuntu/ wily-proposed main restricted universe multiverse # Canonical 合作夥伴和附加 deb http://archive.canonical.com/ubuntu/ wily partner deb http://extras.ubuntu.com/ubuntu/ wily main
14.04
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse ##測試版源 deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse # 源碼 deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse ##測試版源 deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse # Canonical 合作夥伴和附加 deb http://archive.canonical.com/ubuntu/ trusty partner deb http://extras.ubuntu.com/ubuntu/ trusty main
12.04
deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse ##測試版源 deb http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse # 源碼 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse ##測試版源 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse # Canonical 合作夥伴和附加 deb http://archive.canonical.com/ubuntu/ precise partner deb http://extras.ubuntu.com/ubuntu/ precise main