在一般情況下 Ubuntu LTS 會保持在一開始發布的 Linux Kernel 版本,如果想要更新 Linux Kernel 版本,就可以使用 Ubuntu LTS enablement 通常稱它為 Hardware Enablement 硬體支援 (HWE),它提供了新版本的 Kernel 與 xorg 支援。
而在安裝過程中它也會更新系統相依套件,如果系統的網卡驅動 NIC 或是陣列卡驅動 RAID 卡不符合或是在前一個版本還沒支援,也可以通過升級來解決。
桌面版本與伺服器版本差別
如果你是安裝桌面般本預設會啟用 HWE,所以預設情況下會自動得到一般更新與 Kernel 更新。
但是如果安裝的是伺服器版本 20.04 就需要手動安裝 HWE 才可以獲得 Ubuntu 提供的 LTS Kernel 更新。
Ubuntu 20.04 LTS – Focal Fossa
桌面版本安裝
在 20.04 桌面版本安裝起來比較麻煩需要先檢查系統是否是 OEM 版本,可以通過指令檢查ubuntu-drivers list-oem
出現以下代表系統非 OEM 版本
ubuntu@localhost:~$ ubuntu-drivers list-oem Command 'ubuntu-drivers' not found, but can be installed with: sudo apt install ubuntu-drivers-common
出現以下代表系統為 OEM 版本
ubuntu@localhost:~$ ubuntu-drivers list-oem usage: ubuntu-drivers [-h] [--package-list PATH] <command> ubuntu-drivers: error: argument <command>: invalid choice: 'list-oem' (choose from 'list', 'devices', 'autoinstall', 'debug')
而以下指令會列出可以安裝的套件
ubuntu@localhost:~$ ubuntu-drivers list nvidia-driver-495 nvidia-driver-465 nvidia-driver-470
找到相對硬的版本就可以直接安裝它
ubuntu@localhost:~$ sudo apt install nvidia-driver-495
找到適當的 NVIDIA NNN 版本就可以用以下安裝
sudo apt install --install-recommends linux-modules-nvidia-NNN-generic
假設我們選擇 nvidia-driver-495 就可以使用以下安裝
sudo apt install --install-recommends linux-modules-nvidia-495-generic
安裝後重開機沒問題就可以把套件移除
sudo apt remove --purge linux-generic-hwe-20.04 linux-oem-20.04 linux-hwe-* linux-oem-* linux-modules-5.1* linux-modules-5.8.0-* linux-modules-5.6.0-*
伺服器版本安裝
sudo apt install --install-recommends linux-generic-hwe-20.04
Ubuntu 18.04 LTS – Bionic Beaver
桌面版本安裝
sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04
伺服器版本安裝
sudo apt-get install --install-recommends linux-generic-hwe-18.04
檢查 HWE 的 EOL 時間
安裝成功後可以使用 hwe-support-status
檢查系統的 EOL 時間
ubuntu@localhost:~$ hwe-support-status --verbose Your Hardware Enablement Stack (HWE) is supported until April 2025.
參考資料
- https://help.ubuntu.com/lts/installation-guide/s390x/ch03s03.html
- https://wiki.ubuntu.com/Kernel/LTSEnablementStack
《AWS CDK 完全學習手冊:打造雲端基礎架構程式碼 IaC》
第 12 屆 iT 邦幫忙鐵人賽 DevOps 組冠的《用 CDK 定 義 AWS 架構》
第 11 屆 iT 邦幫忙鐵人賽《LINE bot 好好玩 30 天玩轉 LINE API》
一個熱愛分享的雲端工程師!