将Windows10 Linux子系统(Ubuntu)软件源换为国内的地址

2018年12月13日 6693点热度 0人点赞 0条评论

Windows10 Linux子系统(Ubuntu)软件源默认是国外的,国内访问速度较慢,可以将其替换为国内地址提升软件下载和更新速度。

替换方法

使用vi编辑器编辑/etc/apt/sources.list文件,操作前备份一个,以防出现异常能够还原。可能需要root权限,因此加上sudo

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

在文件的最前面粘贴国内源,国内源有很多,随便选一个就行

保存后执行下面两行代码更新一下

sudo apt-get update
sudo apt-get upgrade

阿里云源

deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

网易源

deb https://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb https://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

清华源

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

大魔王

这个人很懒,什么都没留下

文章评论