linux 18.04换源
时间: 2023-12-19 08:28:12 浏览: 45
要在Ubuntu 18.04中更换软件源,可以按照以下步骤操作:
1. 打开终端(快捷键为Ctrl+Alt+T);
2. 备份原有的软件源列表文件:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak;
3. 打开软件源列表文件:sudo gedit /etc/apt/sources.list;
4. 将文件中的内容替换为以下内容:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic 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
##测试版源
# deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
5. 保存并关闭文件;
6. 更新软件源列表:sudo apt-get update。