您好,登錄后才能下訂單哦!
一、ubuntu-16.04.6-server-amd64 安裝與LVM分區步驟
Install Ubuntu Server
Choose English
Select United States
不要檢測鍵盤
選擇英文鍵盤
Press ENTER
建帳號
兩次確認密碼
選擇YES,繼續使用弱密碼,(正式環境建議設置為高復雜度密碼)。
是否加密使用者目錄,選擇否。
選擇東部時區,不用變動。
選擇手動分區,繼續。
先建立一個空分區,如下圖:
選中剛才建立的空分區,按回車。
創建新分區,先建200MB的boot分區。
boot分區分配200MB即可
選擇為主分區
Choose Beg
選擇掛接點為/boot
接著創建第二主分區
繼續創建主分區
直接回車,將全部空間劃給第二主分區。
一樣回車進行下一步
選擇邏輯卷管理器進行VG與LV創建。
直接回車寫入到磁盤。
創建卷組,命名為VolGroup
選擇第二個磁盤,直接回車。
選擇YES,ENTER
接著創建邏輯卷
先創swap/root/data三個LV
選擇卷組VolGroup,回車。
創建swap
分配5G空間給SWAP
按照以上步驟完成根分區,資料分區的LV創建。
接著設定邏輯卷掛接點與文件格式。
全部完成LV分區如下
回車后完成分區進行下一步安裝。
若需要代理上網輸入IP,沒有直接回車。
Press Enter
我是用于虛擬化環境,直接選擇以下兩項即可。
共計236個安裝包,兩三分鐘即可完成安裝,下一步直接回車。
press enter完成安裝。
安裝完成后,啟動畫面如下:
二、Ubuntu Sever 16優化
vi /etc/default/grub找到GRUB_CMDLINE_LINUX=""改為
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
然后執行sudo grub-mkconfig -o /boot/grub/grub.cfg
vi /etc/network/interfaces
將ens192修改成eth0
重啟后,網卡名稱變成了eth0
若系統為Ubuntu 18.04以上則還需要修改以下文件
vi /etc/netplan/*.yaml
network:
ethernets:
eth0:
addresses: []
dhcp4: true
version: 2
vi /etc/sysctl.d/99-sysctl.conf
復制并粘貼以下3行在文件的底部。
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
保存并關閉文件。 然后執行以下命令加載上述更改。
sudo sysctl -p
root@ubuntu:~# vi /etc/sysctl.d/99-sysctl.conf
root@ubuntu:~# sudo sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
root@ubuntu:~# cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1
刪除VIRBR0
ifconfig virbr0 down
brctl delbr virbr0
systemctl disable libvirtd.service
禁用網橋
virsh net-destroy default
完成以上四步后檢驗如下:
uname -a 查看當前運行內核
dpkg --get-selections |grep linux-image 查看所有內核版本
sudo apt-get purge linux-image-4.10.0-28-generic 移除非當前使用版本
2. Ubuntu缺省更新源為國外,若需要更改為國內更新源。
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
> /etc/apt/sources.list?
vi /etc/apt/sources.list
將以下內容
CP
到
sources.list
文件中
deb http://mirrors.aliyun.com/ubuntu trusty main restricted
deb-src http://mirrors.aliyun.com/ubuntu trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu trusty universe
deb-src http://mirrors.aliyun.com/ubuntu trusty universe
deb http://mirrors.aliyun.com/ubuntu trusty-updates universe
deb-src http://mirrors.aliyun.com/ubuntu trusty-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu trusty multiverse
deb-src http://mirrors.aliyun.com/ubuntu trusty multiverse
deb http://mirrors.aliyun.com/ubuntu trusty-updates multiverse
deb-src http://mirrors.aliyun.com/ubuntu trusty-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
然後執行以下命令,刷新:
sudo apt-get clean
sudo apt-get update
三、升級Ubuntu Server 16到Ubuntu Server 18
1.確認當前版本
root@ubuntu-template:/home/ncadmin# uname -r
4.4.0-151-generic
root@ubuntu-template:/home/ncadmin# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
root@ubuntu-template:/home/ncadmin#
更新確保要使用官方更新源,且執行apt update && apt upgrade無報錯
2.再執行do-release-upgrade 命令進行升級
root@ubuntu-template:/home/ncadmin# do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]??????????????????????????????????????????????????????????????????????????
Get:2 Upgrade tool [1,245 kB]?????????????????????????????????????????????????????????????????????????????????
Fetched 1,246 kB in 0s (0 B/s)????????????????????????????????????????????????????????????????????????????????
authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg'
extracting 'bionic.tar.gz'
Reading cache
Checking package manager
Continue running under SSH?
This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.
If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?
Continue [yN]? y
按照提示即可完成更新,詳細步驟不用贅述!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。