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