How to prevent Ubuntu kernel updates – disable or stop Linux kernel updates

If for some reason you want to keep your Linux kernel updates on Ubuntu, follow the steps below in this article. You can use this method to update your Ubuntu Linux system without updating the Linux kernel. It saves some space on your system and prevents some manual system kernel related configuration changes. But keeping kernel updates is not a good idea.

Keep Ubuntu Linux kernel updates

Open a terminal application. It can be opened by pressing Ctrl + Alt + T simultaneously.

Stop the Ubuntu kernel update via apt.

syntax:

Replace linux-package-name with the actual Linux kernel image.

sudo apt-mark hold 

Example:

sudo apt-mark hold linux-image-generic linux-headers-generic
sudo apt-get update

Preventing Ubuntu kernel updates (1)

Enable Ubuntu kernel updates.

You can enable kernel update with the following command.

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

Prevent Ubuntu kernel updates (2)

Stop the Ubuntu kernel update in the configuration file.

At the terminal

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

Scroll down to find the blacklist section and use the Linux kernel package to edit it as follows: Regular expressions are also supported here.

Unattended-Upgrade::Package-Blacklist {
"linux-generic";
"linux-image-generic";
"linux-headers-generic";
};

Stop the Ubuntu kernel update via dpkg.

echo " hold" | sudo dpkg --set-selections

The above syntax is conman to hold all packages. For the Linux kernel, replace Linux-package-name with the 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 like this article, please subscribe to us Youtube channel.. You can also stay connected with us twitter And Facebook..

Recommended Recommendation: How to Install Midnight Commander on Ubuntu-Text Based File Manager
It’s a sequel.
..

Sidebar