更换Ubuntu软件源

2023-03-17 13:44:26 浏览数 (1)

由于Ubuntu官方软件源太慢了,换回国内的软件源这样快很多。

1. 备份源配置文件

代码语言:javascript复制
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 修改配置文件

代码语言:javascript复制
sudo gedit /etc/apt/sources.list 

覆盖sources.list配置文件的内容:

代码语言:javascript复制
# 清华大学软件源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

3. 更新软件源

代码语言:javascript复制
sudo apt-get update

0 人点赞