1 vim /etc/apt/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-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports 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
2 vim /etc/resolv.conf
添加以下内容
#阿里云的DNS服务器
nameserver 223.5.5.5
nameserver 223.6.6.6
3 sudo apt-get update
Get:1 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB]
Hit:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Hit:5 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Get:6 http://mirrors.aliyun.com/ubuntu bionic/main Sources [829 kB]
Get:7 http://mirrors.aliyun.com/ubuntu bionic/restricted Sources [5,324 B]
Get:8 http://mirrors.aliyun.com/ubuntu bionic/universe Sources [9,051 kB]
Get:9 http://mirrors.aliyun.com/ubuntu bionic/multiverse Sources [181 kB]
Get:10 http://mirrors.aliyun.com/ubuntu bionic/main amd64 Packages [1,019 kB]
Get:11 http://mirrors.aliyun.com/ubuntu bionic/main Translation-en [516 kB]
Get:12 http://mirrors.aliyun.com/ubuntu bionic/restricted amd64 Packages [9,184 B]
Get:13 http://mirrors.aliyun.com/ubuntu bionic/restricted Translation-en [3,584 B]
Get:14 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 Packages [8,570 kB]
Get:15 http://mirrors.aliyun.com/ubuntu bionic/universe Translation-en [4,941 kB]
Get:16 http://mirrors.aliyun.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:17 http://mirrors.aliyun.com/ubuntu bionic/multiverse Translation-en [108 kB]
Fetched 25.6 MB in 7s (3,674 kB/s)
Reading package lists... Done