Ubuntu新安装后,默认使用官方的源,在国内访问速度很慢,这里介绍如何更换为阿里源。
1. 更换源
1.1 查看Ubuntu系统codename
1 2 3 4 5 6
| $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial
|
1.2 备份官方源文件,并替换为阿里源
1 2 3 4
| $ cd /etc/apt $ sudo cp source.list source.list.bak $ vim source.list :%s/cn.archive.ubuntu.com/mirrors.aliyun.com/g
|
1.4 更新源&软件
1 2
| $ sudo apt update $ sudo apt upgrade
|