1.备份原始文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
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

截图没注意 改成官方源了,还得再改一遍
6.更新源(前面已经获得超级管理员权限)
apt-get update
apt-get upgrade

本文详细介绍了如何在Ubuntu系统中更换软件包源至阿里云镜像,包括备份原始文件、获得超级管理员权限、修改配置文件以及更新源等步骤。

被折叠的 条评论
为什么被折叠?



