在繼續(xù)進(jìn)行操作之前,請確保對所有重要文件進(jìn)行本地備份,升級可能會失敗,并且服務(wù)器將無法使用!
升級實(shí)際上取決于在系統(tǒng)上執(zhí)行的自定義和安裝的軟件數(shù)量。附加軟件的數(shù)量越多,需要手動解決的軟件包沖突風(fēng)險就越高。
1.準(zhǔn)備
在繼續(xù)之前,系統(tǒng)需要獲取軟件包的所有未決更新。如果您最近沒有安裝更新,則可能需要一些時間。
由于依賴關(guān)系而已安裝且不再需要的軟件包也應(yīng)刪除。
:~#apt-get update && apt-get upgrade -y
:~#apt-get autoremove
2.調(diào)整apt.conf(Debian)
以下命令將在任何存儲庫條目中將“ stretch”替換為“ buster”。
如果您手動添加了其他存儲庫,而這些存儲庫可能會失敗,則必須手動調(diào)查或禁用那些軟件包源。
:~#sed -i ‘s/stretch/buster/g’ /etc/apt/sources.list
:~#sed -i ‘s/stretch/buster/g’ /etc/apt/sources.list.d/*
通常,不應(yīng)配置其他軟件包源,并且您的源列表將具有以下配置:
:~# cat /etc/apt/sources.list
deb http://asi-fs-n.contabo.net/Debian buster main non-free contrib
deb http://security.Debian.org/Debian-security buster/updates main contrib non-free
deb-src http://security.Debian.org/Debian-security buster/updates main contrib non-free
deb http://asi-fs-n.contabo.net/Debian buster-updates main contrib non-free
3. a)開始升級(Debian)
以下命令將開始升級,也將更新軟件包。
:~#apt clean && apt update
:~# apt upgrade -y
:~# apt dist-upgrade -y
:~# apt autoremove
:~# cat /etc/os-release
PRETTY_NAME=”Debian GNU/Linux 10 (buster)”
VERSION_ID=”10″
VERSION=”10 (buster)”
VERSION_CODENAME=buster
ID=Debian
HOME_URL=”https://www.Debian.org/”
SUPPORT_URL=”https://www.Debian.org/support”
bug_REPORT_URL=”https://bugs.Debian.org/”
3. b)開始升級(Ubuntu)
Ubuntu為此目的提供了一個工具/命令:“ do-release-upgrade”,它將更新到下一個可用的LTS版本,因此從14.04 LTS到16.04或從16.04 LTS到18.04 LTS。
如果找不到該命令并且缺少該工具,則可以使用以下命令進(jìn)行安裝:
:~# apt-get install update-manager-core
4.重新啟動服務(wù)器
為了使用最近安裝的內(nèi)核,您將必須重新引導(dǎo)服務(wù)器。重新啟動后,您正在運(yùn)行最新版本的Debian(穩(wěn)定)/ Ubuntu LTS。