ubuntu更换源(更换为阿里源,亲测有效)
1.修改source文件
sudo vim /etc/apt/sources.list
#sudo nano /etc/apt/sources.list //没有vim的话用nano
将以下内容全部替换到.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
2.修改网络配置文件
sudo vim /etc/resolv.conf
#sudo nano /etc/resolv.conf
加入:
nameserver 8.8.8.8
nameserver 8.8.4.4
重启网卡
sudo /etc/init.d/networking restart