首页 > 系统服务 > 详细

ubuntu如何修改IP地址、和apt源

时间:2019-06-11 10:12:36      阅读:219      评论:0      收藏:0      [点我收藏+]
新安装的ubuntu没有vim,使用vi修改自己的IP地址

root@doupai-KVM:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto ens3
iface ens3 inet static
address 192.168.200.7
netmask 255.255.255.0
gateway 192.168.200.1
dns-nameserver 192.168.200.200

ubuntu系统如何修改apt源,使用aliyun源为例:
将旧版本内容做好备份。

root@doupai-KVM:~# cp /etc/apt/sources.list /etc/apt/sources.list_bak

添加以下内容

root@doupai-KVM:~# cat /etc/apt/sources.list
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

更新自己的源,即可

root@doupai-KVM:~# apt update
root@doupai-KVM:~# apt-get update

接下来验证源是否正常使用:

root@doupai-KVM:~# apt install -y openssh-server vim net-tools lrzsz

ubuntu如何修改IP地址、和apt源

原文:https://blog.51cto.com/12131824/2406971

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!