If you want to hold the Linux kernel update for some reason on your Ubuntu, then follow below steps in this article. Using this method you can update your Ubuntu Linux system without Updating the Linux Kernel. It will save some space in your system and also prevent the some manual system kernel related configuration changes. But holding the kernel update is not a good idea.
Hold Ubuntu Linux Kernel Update
Open your terminal application. You can open it by press ctrl+alt+t together.
Stop the Ubuntu Kernel Update via apt:
syntax:
Replace linux-package-name with actual linux kernel image.
sudo apt-mark hold <linux-package-name>
example:
sudo apt-mark hold linux-image-generic linux-headers-generic
sudo apt-get update
Enable Ubuntu kernel Update:
You can enable kernel updates via below command.
sudo apt-mark unhold linux-image-generic linux-headers-generic
Stop the Ubuntu Kernel Update via config file:
In terminal run
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
Scroll down and locate the blacklist section and edit like below with the Linux kernel packages. Here regex is also supported.
Unattended-Upgrade::Package-Blacklist { "linux-generic"; "linux-image-generic"; "linux-headers-generic"; };
Stop the Ubuntu Kernel Update via dpkg:
echo "<Linux-package-name> hold" | sudo dpkg --set-selections
Above syntax is conman for all packages to hold. For Linux kernel replace the Linux-package-name with your Linux kernel image.
echo linux-image-5.4.0-33-generic hold | sudo dpkg --set-selections
echo linux-image-generic hold | sudo dpkg --set-selections
echo linux-generic hold | sudo dpkg --set-selections