分享页面

Ubuntu18.04如何配置系统软件源

发布时间:2021-07-27 10:55
 

Ubuntu18.04系统如何对软件源进行配置呢?本文将针对此问题进行说明。

由于ubuntu默认使用国外的软件源,这边展示如何更换成国内的软件源,以便获取更好的体验。国内有很多ubuntu的镜像源,例如网易,阿里,清华大学等等,这边展示如何更换成清华大学的镜像源。

1.首先,对旧的镜像源进行备份

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

2.然后对镜像源配置文件进行修改

sudo vi /etc/apt/sources.list

 

在文件最前面添加以下内容:

 

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

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

3.修改完成后,保存文件。运行:

sudo apt-get update

sudo apt-get upgrade

配置完成。

说明:如果需要更换其他源,可以在网上搜索对应的源配置。

 

本文导读