首先备份源列表(for sure):

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

而后用gedit或其他编辑器打开/etc/apt/sources.list:

nano /etc/apt/sources.list

注意:一定要选对版本
模板:12.04source

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

模板:14.04source

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-proposed main restricted universe multiverse
# 源码
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ trusty partner
deb http://extras.ubuntu.com/ubuntu/ trusty main

可将 http://cn.archive.ubuntu.com/ubuntu/ 替换为下列任意服务器:

Ubuntu 官方(欧洲,国内较慢,无同步延迟)

http://archive.ubuntu.com/ubuntu/

Ubuntu 官方中国(目前是阿里云)

http://cn.archive.ubuntu.com/ubuntu/

教育网
以下服务器有教育网接入,推荐教育网用户使用 IPv6:
中科大 LUG(合肥,电信/联通/移动/教育网自动分流,同时也是 Deepin 官方)

https://mirrors.ustc.edu.cn/ubuntu/ (v4/v6) http://mirrors4.ustc.edu.cn/ubuntu/ (v4) http://mirrors6.ustc.edu.cn/ubuntu/ (v6)

中科院 OpenCAS

http://mirrors.opencas.cn/ubuntu/

清华 TUNA(教育网核心节点百兆接入,已计划提高到千兆)

http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ (v4/v6) http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ (v4) http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ (v6)

大陆地区以外
香港中文大学更新服务器,由香港中文大学资讯科技服务处维护

http://ftp.cuhk.edu.hk/pub/Linux/ubuntu

香港 01link 更新服务器,由香港联达网络服务有限公司维护

http://ubuntu.01link.hk

香港 uhost 更新服务器,由香港互联科技有限公司维护

http://ubuntu.uhost.hk

台湾的官方源。速度有时甚至快于内地的,包含 ian 等其他镜像

http://tw.archive.ubuntu.com/ubuntu

然后,刷新列表:

sudo apt-get update

注意:一定要执行刷新


如果出现

W: GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192

则执行

gpg --keyserver keyserver.ubuntu.com --recv 3E5C1192
gpg --export --armor  3E5C1192 | sudo apt-key add -

然后再刷新列表