由于安装的ubuntu18.04默认使用的是国外的源,下载更新的速度比较慢,所以替换成国内的源。国内的源有很多,包括阿里云、清华、163等。我这里使用的是阿里云的。
备份原来的源
sudo cp /etc/apt/sources.list /etc/apt/sourses.list.backup
修改源为阿里云
打开/etc/apt/sources.list
文件
sudo gedit /etc/apt/sources.list
将文件内容改为如下
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
更新源以及升级软件包
sudo apt-get update
sudo apt-get upgrade