当前位置: 首页 > 工具软件 > Bionic > 使用案例 >

ubuntu手动替换阿里镜像源(版本18.04(bionic))

盖高畅
2023-12-01

1.对原文件备份

sudo cp /etc/apt/sources.list /etc/apt/sources_cope.list

2. 打开要换源的文件

sudo gedit /etc/apt/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-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

 替换完成后保存退出。

3.更新

用于访问上面替换的源列表中的每个网址,读取软件列表保存在本地电脑 

sudo apt-get update

 

 类似资料: