Ubuntu 切换国内软件源

1. 备份

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

2. 查询系统代号

ubuntu@ubuntu:/etc/apt$ lsb_release -c
Codename:       eoan

3. 修改

将/etc/apt/sources.list的内容替换成下面的任意一个国内软件源

#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse

#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse

#163源
deb http://mirrors.163.com/ubuntu/ eoan main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-backports main restricted universe multiverse

#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse

需要注意的一点是, 笔者使用的Ubuntu版本号是19.10, 对应的系统代号是eoan, 如果是其他版本的Ubuntu 需要将上述链接中的eoan替换成对应版本的系统代号, 例如19.04版本的disco.

4. 更新

sudo apt-get update

你可能感兴趣的:(Ubuntu 切换国内软件源)