240
世界上有10种人,一种懂二进制,另一种不懂二进制。

Ubuntu18.04更换国内源(阿里,网易,中科大,清华等源)

1.备份

备份/etc/apt/sources.list文件

mv /etc/apt/sources.list /etc/apt/sourses.list.backup

2.新建

新建/etc/apt/sources.list文件并添加以下内容

在root管理员下

//切换到管理员
sudo su
//新建文件并写入
vi /etc/apt/sources.list

2.1 阿里源:

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

2.2 其它源

#清华源
deb 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 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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

 

2.3 扩展

Ubuntu 官方(歐洲,國內較慢,無同步延遲)http://archive.ubuntu.com/ubuntu/

Ubuntu 官方中國(目前是阿里云)http://cn.archive.ubuntu.com/ubuntu/

網易(廣東廣州電信/聯通千兆雙線接入)http://mirrors.163.com/ubuntu/

搜狐(山東聯通千兆接入)http://mirrors.sohu.com/ubuntu/

阿里云(北京萬網/浙江杭州阿里云服務器雙線接入)http://mirrors.aliyun.com/ubuntu/

详情见:http://wiki.ubuntu.org.cn/模板:18.04source

3 更新

更改完成之后执行以下命令 

apt update 
apt upgrade

4 参考

4.1 Ubuntu18.04更换国内源

4.2  apt-get 软件源文件格式以及ubuntu 18.04更换阿里源 (源内容格式的原理) 

4.3 ubuntu中文模板源

 

posted @ 2019-02-23 16:19  unionline  阅读(34615)  评论(0)    收藏  举报