新安装的ubuntu没有vim,使用vi修改自己的IP地址
[email protected]:~# 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源为例:
将旧版本内容做好备份。
[email protected]:~# cp /etc/apt/sources.list /etc/apt/sources.list_bak
添加以下内容
[email protected]:~# 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
更新自己的源,即可
[email protected]:~# apt update
[email protected]:~# apt-get update
接下来验证源是否正常使用:
[email protected]:~# apt install -y openssh-server vim net-tools lrzsz
原文地址:https://blog.51cto.com/12131824/2406971
时间: 2024-09-30 00:20:38