How to Prevent Ubuntu kernel Update – Disable or Stop Linux Kernel Update

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.

Prevent-Ubuntu-kernel-Update

 

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

Prevent Ubuntu kernel Update (1)

Enable Ubuntu kernel Update:

You can enable kernel updates via below command.

sudo apt-mark unhold linux-image-generic linux-headers-generic

Prevent Ubuntu kernel Update (2)

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
If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Also Read:  How to Encode and Decode Using base64 in Linux

Leave a Reply