换源原因
还用说吗,官方服务器在海外,速度太慢了。
更换源步骤
1.更改源文件的权限
如果是以普通用户状态进入系统的,推荐先更改源文件的独写权限,这样子方便后续维护操作。
sudo chmod 777 /etc/apt/sources.list
2.更改源文件内容
可以利用vim等编辑器进入sources.list之后禁用默认的源,直接在默认源之前加入#即可。 然后在sources.list里面添加以下内容(阿里云)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse
更新与升级
sudo apt-get update
sudo apt-get upgrade
上面这两个命令的顺序尽量不要错,调换顺序的影响暂时不清楚,也不想尝试,麻烦。。