Ubuntu替换国内源

北慕城南 提交于 2020-08-06 08:17:26

网络环境的原因,官方的apt的源的速度比较慢,打算替换为国内源,正好学校有Ubuntu的源,所以替换下

编辑文件/etc/apt/sources.list 将其中的内容换为对应的系统的目标源即可。

选择你的ubuntu版本,以wily为例:

deb http://mirrors.xjtu.edu.cn/ubuntu/ wily main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ wily-backports main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ wily-proposed main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ wily-security main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ wily-updates main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ wily main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ wily-backports main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ wily-proposed main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ wily-security main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ wily-updates main multiverse restricted universe

这里,查询得知我的系统为:

lsb_release -a
#输出如下:
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic

所以将上面的源路径的wily换为bionic,如下:

deb http://mirrors.xjtu.edu.cn/ubuntu/ bionic main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ bionic-backports main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ bionic-proposed main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ bionic-security main multiverse restricted universe
deb http://mirrors.xjtu.edu.cn/ubuntu/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ bionic main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ bionic-proposed main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ bionic-security main multiverse restricted universe
deb-src http://mirrors.xjtu.edu.cn/ubuntu/ bionic-updates main multiverse restricted universe

然后,

sudo apt-get update 

完成!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!