I switched to the zabbly kernel for Ubuntu. Does it make sense to disable generic Ubuntu kernel updates

Ubuntuzabbly

I have been using the Zabbly kernel for Ubuntu 22.04.4 LTS for several months now and it works great but Ubuntu still wants to install its own, generic kernel and I don't want it.

Question one: does the system need the generic kernel (modules, headers) for anything?

Question two: if the answer to question one is no, how do I blacklist the installation of new generic Ubuntu kernels?

I want to prevent the installation of any new Ubuntu kernels.

2024/04/24 update: I'm still being asked to install generic kernel packages.

apt wants to install
linux-headers-generic/jammy-updates 5.15.0.105.102 amd64 [upgradable from: 5.15.0.102.99]
apt-mark hold linux-headers-generic
linux-headers-generic was already set on hold.

Best Answer

Question 1: Does the system need the generic kernel?

Maybe, but probably not in your case. The generic kernel provides broad hardware compatibility and serves as the default for Ubuntu. If the Zabby kernel works flawlessly for your system, you likely don't need the generic kernel.

However, there are a few reasons you might still want the generic kernel:

  • Future hardware compatibility: If you add new hardware that requires specific drivers, the generic kernel might have them included, while Zabby might not.
  • Fallback option: In case of an issue with the Zabby kernel, having the generic kernel as a backup allows you to boot and potentially troubleshoot.

Question 2: How to blacklist generic kernel updates?

It's possible to blacklist generic kernel updates, but it's generally not recommended. Kernel updates often contain security fixes and performance improvements. Here's how to do it with caution (proceed only if you're sure):

  1. Be aware of the risks: Disabling updates can leave your system vulnerable.
  2. Identify current kernel version: Use uname -r to find the current kernel version (e.g., 5.15.0-46-generic).
  3. Blacklist packages (careful!): Use two methods (choose one):
    • Using apt: Edit /etc/apt/apt.conf.d/50unattended-upgrades (use sudo nano). In the Unattended-Upgrade::Package-Blacklist section, add the following lines (replace version with yours):
      linux-image-generic-5.15.0-46
      linux-headers-generic-5.15.0-46
      
    • Using dpkg: (For more advanced users) Use sudo dpkg --set-selections hold linux-image-generic linux-headers-generic. This holds all versions of these packages.

Recommendation:

Instead of disabling updates, consider these alternatives:

  • Boot with Zabby: If Zabby works well, configure GRUB to boot by default with the Zabby kernel. You'll still have the generic kernel available in the boot menu if needed.
  • Update strategically: Update the generic kernel occasionally (e.g., monthly) to benefit from security fixes.
Related Topic