最近我的 Linux 自行更新了内核,因此导致我的启动内存不足,我试图删除旧的 Linux 内核版本:6.2.0 和 5.19.0.45
saba@saba:~$ dpkg --list | grep linux-image
pi linux-image-5.19.0-45-generic 5.19.0-45.46~22.04.1 amd64 Signed kernel image generic
ii linux-image-5.19.0-46-generic 5.19.0-46.47~22.04.1 amd64 Signed kernel image generic
ii linux-image-5.19.0-50-generic 5.19.0-50.50 amd64 Signed kernel image generic
pi linux-image-6.2.0-26-generic 6.2.0-26.26~22.04.1 amd64 Signed kernel image generic
我正在尝试使用 Mainline Kernels 应用程序进行删除(我也尝试过手动删除,但结果是一样的)
但它显示以下错误:
mainline 1.4.8
uninstall 6.2.0-26.26~22.04.1
Uninstalling 6.2.0-26.26~22.04.1
dpkg: dependency problems prevent removal of linux-image-6.2.0-26-generic:
linux-signatures-nvidia-6.2.0-26-generic depends on linux-image-6.2.0-26-generic | linux-image-unsigned-6.2.0-26-generic; however:
Package linux-image-6.2.0-26-generic is to be removed.
Package linux-image-unsigned-6.2.0-26-generic is not installed.
linux-modules-nvidia-525-6.2.0-26-generic depends on linux-image-6.2.0-26-generic | linux-image-unsigned-6.2.0-26-generic; however:
Package linux-image-6.2.0-26-generic is to be removed.
Package linux-image-unsigned-6.2.0-26-generic is not installed.
dpkg: error processing package linux-image-6.2.0-26-generic (--purge):
dependency problems - not removing
dpkg: dependency problems prevent removal of linux-modules-6.2.0-26-generic:
linux-image-6.2.0-26-generic depends on linux-modules-6.2.0-26-generic.
dpkg: error processing package linux-modules-6.2.0-26-generic (--purge):
dependency problems - not removing
Errors were encountered while processing:
linux-image-6.2.0-26-generic
linux-modules-6.2.0-26-generic
mainline: done
无论内核版本是什么,都会出现同样的错误。
当我尝试手动删除它时,我会这样做:
sudo apt-get --purge remove linux-image-6.2.0-26-generic
在日志的末尾得到了这个
/var/lib/dpkg/info/linux-image-6.2.0-26-generic.postrm ... removing pending trigger
rmdir: failed to remove '/lib/modules/6.2.0-26-generic': Directory not empty
Processing triggers for linux-image-unsigned-6.2.0-26-generic (6.2.0-26.26~22.04.1) ...
dpkg --list | head -n 4
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
那么我该如何删除它们?为什么会发生这种情况?