Ubuntu把软件源修改为国内源和更新

1.备份原始文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup在这里插入图片描述
2.sudo su获得超级管理员权限
3.打开配置文件

vi /etc/apt/sources.list
4.在源文件开始添加如下地址并保存退出

#添加阿里源
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-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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates 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
6.更新源(前面已经获得超级管理员权限)

apt-get update
apt-get upgrade
 

发布了445 篇原创文章 · 获赞 71 · 访问量 28万+

猜你喜欢

转载自blog.csdn.net/dxm809/article/details/104211201