1.打开/etc/apt目录,找到sources.list文件,使用vim编辑器修改内容。
cd /etc/apt
vi sources.list
2.在修改sources.list文件之前,查看自己安装的ubuntu系统名称。
lsb_release -a
我的ubuntu系统输出内容如下:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
3.我的ubuntu系统名称为bionic,将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-backports main restricted universe multiverse
4.然后更新数据源
apt-get update