Ubuntu18.04更换国内源

1. 备份原来的源文件 /etc/apt/sources.list

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bk

2. 新建文件 /etc/apt/sources.list

sudo vim /etc/apt/sources.list

3. 将国内源粘贴复制进去

  • 阿里源
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-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

4. 手动update一下

sudo apt update

你可能感兴趣的:(Ubuntu18.04更换国内源)