Ubuntu修改APT软件源教程
最后更新时间:2022-01-21 16:01:22
Linux拥有众多的发行版,每个发行版都有提供镜像,但是,有些镜像的下载速度参差不齐,偶尔会有更新失败的情况。
下面以修改 Ubuntu 软件源为中科大为例进行说明。
镜像地址:https://mirrors.ustc.edu.cn/
1.备份原配置文件
# cp /etc/apt/sources.list /etc/apt/sources.list.backup
2.更改配置文件
编辑/etc/apt/sources.list文件
, 将内容修改为:
Xenial(16.04)
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial universe
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates universe
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security universe
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security multiverse
Trusty(14.04)
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty universe
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-updates universe
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-updates multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-security universe
deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-security multiverse
Precise(12.04)
deb https://mirrors.ustc.edu.cn/ubuntu/ precise main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ precise universe
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
deb https://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-security main restricted
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-security universe
deb https://mirrors.ustc.edu.cn/ubuntu/ precise-security multiverse
3.更新
# apt-get update
如果在操作过程有任何疑问,欢迎在后台提交工单。