Ubuntu 软件包仓库¶
说明¶
Ubuntu 软件源
收录架构¶
AMD64 (x86_64), Intel x86
收录版本¶
所有 Ubuntu 当前支持的版本,包括开发版,具体版本见 https://wiki.ubuntu.com/Releases
使用说明¶
警告
操作前请做好相应备份
一般情况下,将 /etc/apt/sources.list
文件中 Ubuntu 默认的源地址 http://archive.ubuntu.com/
替换为 https://mirrors.nwafu.edu.cn
即可。
可以使用如下命令:
sudo sed -i 's/archive.ubuntu.com/mirrors.nwafu.edu.cn/g' /etc/apt/sources.list
小技巧
如果你在安装时选择的语言不是英语,默认的源地址通常不是 http://archive.ubuntu.com/
,
而是 http://<country-code>.archive.ubuntu.com/ubuntu/
,如 http://cn.archive.ubuntu.com/ubuntu/
,
此时只需将上面的命令进行相应的替换即可,即
sudo sed -i 's/cn.archive.ubuntu.com/mirrors.nwafu.edu.cn/g' /etc/apt/sources.list
。
也可以直接编辑 /etc/apt/sources.list
文件(需要使用 sudo)。以下是 Ubuntu 18.04 参考配置内容:
# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.nwafu.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.nwafu.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.nwafu.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.nwafu.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.nwafu.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.nwafu.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.nwafu.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.nwafu.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.nwafu.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.nwafu.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
更改完 sources.list
文件后请运行 sudo apt-get update
更新索引以生效。
小技巧
使用 HTTPS 可以有效避免国内运营商的缓存劫持。
镜像下载¶
如果需要下载 Ubuntu 的 ISO 镜像以便安装,请参考 Ubuntu Releases