一、ubuntu-16.04.6-server-amd64 安裝與LVM分區(qū)步驟
為尼元陽等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及尼元陽網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站建設(shè)、做網(wǎng)站、尼元陽網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!
Install Ubuntu Server
Choose English
Select United States
不要檢測鍵盤
選擇英文鍵盤
Press ENTER
建帳號
兩次確認(rèn)密碼
選擇YES,繼續(xù)使用弱密碼,(正式環(huán)境建議設(shè)置為高復(fù)雜度密碼)。
是否加密使用者目錄,選擇否。
選擇東部時區(qū),不用變動。
選擇手動分區(qū),繼續(xù)。
先建立一個空分區(qū),如下圖:
選中剛才建立的空分區(qū),按回車。
創(chuàng)建新分區(qū),先建200MB的boot分區(qū)。
boot分區(qū)分配200MB即可
選擇為主分區(qū)
Choose Beg
選擇掛接點為/boot
接著創(chuàng)建第二主分區(qū)
繼續(xù)創(chuàng)建主分區(qū)
直接回車,將全部空間劃給第二主分區(qū)。
一樣回車進行下一步
選擇邏輯卷管理器進行VG與LV創(chuàng)建。
直接回車寫入到磁盤。
創(chuàng)建卷組,命名為VolGroup
選擇第二個磁盤,直接回車。
選擇YES,ENTER
接著創(chuàng)建邏輯卷
先創(chuàng)swap/root/data三個LV
選擇卷組VolGroup,回車。
創(chuàng)建swap
分配5G空間給SWAP
按照以上步驟完成根分區(qū),資料分區(qū)的LV創(chuàng)建。
接著設(shè)定邏輯卷掛接點與文件格式。
全部完成LV分區(qū)如下
回車后完成分區(qū)進行下一步安裝。
若需要代理上網(wǎng)輸入IP,沒有直接回車。
Press Enter
我是用于虛擬化環(huán)境,直接選擇以下兩項即可。
共計236個安裝包,兩三分鐘即可完成安裝,下一步直接回車。
press enter完成安裝。
安裝完成后,啟動畫面如下:
二、Ubuntu Sever 16優(yōu)化
vi /etc/default/grub找到GRUB_CMDLINE_LINUX=""改為
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
然后執(zhí)行sudo grub-mkconfig -o /boot/grub/grub.cfg
vi /etc/network/interfaces
將ens192修改成eth0
重啟后,網(wǎng)卡名稱變成了eth0
若系統(tǒng)為Ubuntu 18.04以上則還需要修改以下文件
vi /etc/netplan/*.yaml
network:
ethernets:
eth0:
addresses: []
dhcp4: true
version: 2
vi /etc/sysctl.d/99-sysctl.conf
復(fù)制并粘貼以下3行在文件的底部。
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
保存并關(guān)閉文件。 然后執(zhí)行以下命令加載上述更改。
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
禁用網(wǎng)橋
virsh net-destroy default
完成以上四步后檢驗如下:
uname -a 查看當(dāng)前運行內(nèi)核
dpkg --get-selections |grep linux-image 查看所有內(nèi)核版本
sudo apt-get purge linux-image-4.10.0-28-generic 移除非當(dāng)前使用版本
2. Ubuntu缺省更新源為國外,若需要更改為國內(nèi)更新源。
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
> /etc/apt/sources.list?
vi /etc/apt/sources.list
將以下內(nèi)容
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
然後執(zhí)行以下命令,刷新:
sudo apt-get clean
sudo apt-get update
三、升級Ubuntu Server 16到Ubuntu Server 18
1.確認(rèn)當(dāng)前版本
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#
更新確保要使用官方更新源,且執(zhí)行apt update && apt upgrade無報錯
2.再執(zhí)行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
按照提示即可完成更新,詳細步驟不用贅述!
文章名稱:Ubuntu-16.04.6-server安裝、系統(tǒng)優(yōu)化與升級至18.0.4
分享地址:http://muchs.cn/article14/jchdge.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗、定制網(wǎng)站、手機網(wǎng)站建設(shè)、網(wǎng)站改版、網(wǎng)頁設(shè)計公司、域名注冊
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)