网络环境的原因,官方的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
完成!
来源:oschina
链接:https://my.oschina.net/zhangwenwen/blog/4296961