Ubuntu 16.04 uninstall the old kernel and disable kernel updates

Uninstall the old kernel

View the current kernel version

uname -r

View the installed kernel version

dpkg --get-selections | grep linux

All kernels in the grub boot entry

grep menuentry /boot/grub/grub.cfg

Uninstall the old kernel

sudo apt-get purge linux-image-4.15.0-66 linux-headers-4.15.0-66 linux-modules-4.15.0-66

This command will be deleted

linux-headers-4.15.0-66
linux-headers-4.15.0-66-generic
linux-image-4.15.0-66-generic
linux-modules-4.15.0-66-generic
linux-modules-extra-4.15.0-66-generic

Update grub

sudo update-grub

Prohibit kernel updates

The automatic kernel update will cause the nvidia graphics driver to fail.

Update prohibited

sudo apt-mark hold linux-headers-4.15.0-133 linux-headers-4.15.0-133-generic linux-image-4.15.0-133-generic linux-modules-4.15.0-133-generic linux-modules-extra-4.15.0-133-generic

Lift the ban

sudo apt-mark unhold linux-headers-4.15.0-133 linux-headers-4.15.0-133-generic linux-image-4.15.0-133-generic linux-modules-4.15.0-133-generic linux-modules-extra-4.15.0-133-generic

Guess you like

Origin blog.csdn.net/weixin_43742643/article/details/113385299