ubuntu 14.04:
ubuntu 16.04:
ubuntu 18.04:
1)配置網絡卡eth0,本地內網網絡卡無需指定閘道器和網域名稱伺服器
root@ubuntu1804:~# vim /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses: [192.168.1.30/24]
2)配置網絡卡eth1,要保持嚴格縮排,否則會導致網絡卡起不來root@ubuntu1804:~# vim /etc/netplan/02-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth1:
dhcp4: yes
addresses: [192.168.10.107/24]
gateway4: 192.168.10.1
nameservers:
addresses: [223.6.6.6]
1)編輯grub檔案root@ubuntu1804:~#vim /etc/default/grub
……grub_cmdline_linux="net.ifnames=0 biosdevname=0"
……
2)載入更新grub檔案root@ubuntu1804:~#update-grub
3)重啟機器實現網絡卡名更改root@ubuntu1804:~#reboot
4)啟動機器實現網絡卡名的修改1)配置ubuntu倉庫源root@ubuntu1804:~# vim /etc/apt/sources.list
deb bionic main restricted universe multiverse
deb-src bionic main restricted universe multiverse
deb bionic-security main restricted universe multiverse
deb-src bionic-security main restricted universe multiverse
deb bionic-updates main restricted universe multiverse
deb-src bionic-updates main restricted universe multiverse
deb bionic-proposed main restricted universe multiverse
deb-src bionic-proposed main restricted universe multiverse
deb bionic-backports main restricted universe multiverse
deb-src bionic-backports main restricted universe multiverse
2)更新倉庫root@ubuntu1804:~# apt update
get:1 bionic inrelease [242 kb]
get:2 bionic-security inrelease [88.7 kb]
get:3 bionic-updates inrelease [88.7 kb]
get:4 bionic-proposed inrelease [242 kb]
……
3)公升級本機所有已安裝的軟體包root@ubuntu1804:~# apt upgrade
1)在ubuntu18.04中常用的初始化安裝包root@ubuntu1804:~# apt-get install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev gcc openssh-server iotop unzip zip ipmitool -y
2)在centos7的初始化最小化安裝常用軟體包[root@centos7 ~]# yum install vim iotop bc gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel zip unzip zlib-devel net-tools lrzsz tree ntpdate telnet lsof tcpdump wget libevent libevent-devel bc systemd-devel bash-completion traceroute -y
1)編輯ssh遠端服務配置檔案,注釋掉禁止root秘鑰登入root@ubuntu1804:~# vim /etc/ssh/sshd_config
2)再重新啟動sshd服務,即可實現直接以root身份登入虛擬機器或root遠端登入
root@ubuntu1804:~# systemctl restart sshd
Ubuntu 18 04安裝 docker 環境
docker 安裝 apt get remove docker docker engine docker.io ubuntu 14.04 可選核心模組 映象源 curl fssl sudo apt key add curl fssl sudo apt key add add apt reposito...
Ubuntu18 04搭建nodejs環境
首先安裝sudo apt install curl 然後安裝命令 當前最新版本是0.33.2,最新版本可以在檢視 curl o bash 安裝後重啟shell通過以下命令檢視nvm版本 nvm version檢視所有node版本 nvm ls remote 可能由於版本過多導致比較慢,比如此時nod...
Ubuntu18 04設定中文環境
ubuntu系統中,存在兩個系統變數 lang和 language 分別控制語言環境和地區,這兩個變數是從 etc default locale中讀取的,因此設定語言環境又兩種方法。export lang zh cn utf 8 export language zh cn zh echo lang ...