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

1.备份原始文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backupUbuntu把软件源修改为国内源和更新_第1张图片
2.sudo su获得超级管理员权限
3.打开配置文件

vi /etc/apt/sources.list

4.在源文件开始添加如下地址并保存退出
(vi编辑命令可以从网上搜索学习使用)

#添加阿里源
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

Ubuntu把软件源修改为国内源和更新_第2张图片
截图没注意 改成官方源了,还得再改一遍
6.更新源(前面已经获得超级管理员权限)

apt-get update
apt-get upgrade

Ubuntu把软件源修改为国内源和更新_第3张图片

你可能感兴趣的:(-------Linux)