Ubuntu16.04更换国内源
Posted 务实求知
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu16.04更换国内源相关的知识,希望对你有一定的参考价值。
1、前言
在Ubuntu系统上使用"apt-get install"进行软件安装更新的时候,由于使用的源是国外的,网络速度非常缓慢,本文记录在Ubuntu系统上进行更换国内源。
2、Ubuntu换源
首先需要将原始的源文件进行备份,命令行如下:
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
接下来,修改源文件/etc/apt/sources.list,添加国内源:
$ sudo vim /etc/apt/sources.list
先将原文件的内容进行删除,然后添加国内源,常用的国内源有如下:
(1)阿里源
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
(2)清华源
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
将上面给出的源复制到文件/etc/apt/sources.list即可。
最后,使用下面命令进行源更新:
$ sudo apt-get update
源更新完成后,安装自己需要的软件就可以了。
以上是关于Ubuntu16.04更换国内源的主要内容,如果未能解决你的问题,请参考以下文章