Ubuntu
刪除核心時如何防止安裝較新的核心?
在 Ubuntu 上,我在使用一個新核心 (
4.18.0-20
) 時遇到了一些問題,所以我在一個舊核心 ( ) 上重新啟動4.18.0-15
。現在我想解除安裝新核心以防止任何混淆,但這樣做是
apt
為了安裝更新的核心:apt -s remove linux-image-4.18.0-20-generic NOTE: This is only a simulation! apt needs root privileges for real execution. Keep also in mind that locking is deactivated, so don't depend on the relevance to the real current situation! Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: linux-generic-hwe-18.04 linux-headers-4.18.0-21 linux-headers-4.18.0-21-generic linux-headers-generic-hwe-18.04 linux-image-4.18.0-21-generic linux-image-generic-hwe-18.04 linux-modules-4.18.0-21-generic linux-modules-extra-4.18.0-21-generic The following packages will be REMOVED: linux-image-4.18.0-20-generic linux-modules-extra-4.18.0-20-generic The following NEW packages will be installed: linux-headers-4.18.0-21 linux-headers-4.18.0-21-generic linux-image-4.18.0-21-generic linux-modules-4.18.0-21-generic linux-modules-extra-4.18.0-21-generic The following packages will be upgraded: linux-generic-hwe-18.04 linux-headers-generic-hwe-18.04 linux-image-generic-hwe-18.04
所以
apt
想要安裝核心4.18.0-21
,因為它刪除了4.18.0-20
.我該如何解釋這不是我想要的?
問題來自
linux-image-generic-hwe-18.04
包正是這一個帶來了混亂。
解決方案:將其刪除並安裝
linux-image-generic
:sudo apt install linux-image-4.18.0-20-generic sudo apt remove linux-image-generic-hwe-18.04
linux-headers*
如果需要,可以對包進行同樣的操作。如果要將核心設置為特定的,可以手動安裝,例如
sudo apt install linux-image-generic sudo apt remove linux-image-generic-hwe-18.04