Ubuntu更改国内源,设置固定IP和DNS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu更改国内源,设置固定IP和DNS相关的知识,希望对你有一定的参考价值。

一 更改国内源

 

1 首先备份官方源,以免设置错误可恢复。

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.back

 

2 用编辑器打开 /etc/apt/sources.list文件。

$ sudo nano /etc/apt/sources.list

 

3 删除原有的源,在编辑器中添加新源(阿里源)。如图所示:

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

 

二 设置固定IP

 

以上是关于Ubuntu更改国内源,设置固定IP和DNS的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu16.0.4 设置固定ip地址和dns

Ubuntu设置固定IP

ubuntu 15.10 设置静态ip 分配固定ip 设置dns 设置网关 命令行配置ip 固定ip不生效怎么办

VMware workstation Ubuntu设置固定ip地址

ubuntu dns怎么设置方法

ubuntu配置dns后,ping域名等到IP,但ICMP包间隔很大