As a developer using Pop!_OS, keeping your system‘s Linux kernel updated is critical for security, stability and access to the latest performance enhancements and features. But understanding kernel updates can be confusing. In this expert guide, we‘ll cover everything you need to know to safely update Pop!_OS kernels.

Why Keeping Your Kernel Updated Matters

The Linux kernel is essentially the core "brains" of your operating system. It handles process management, memory, device drivers, system calls and more. Kernel updates usually contain important security patches that fix discovered vulnerabilities. Out-of-date kernels expose you to potentially serious security risks.

Beyond security, kernel updates also provide:

  • Bug fixes improving overall OS stability
  • Performance improvements – updated kernels better utilize modern hardware
  • Support for newer components like cutting edge CPUs and GPUs
  • New kernel features enhancing the developer experience

In short, keeping your kernel updated should be part of any developer‘s basic system maintenance routine.

An Introduction to Pop!_OS and Kernel Deployment

In case you‘re unfamiliar, Pop!_OS is an Ubuntu-based Linux distribution from System76 specifically targeted at developers and maker projects. It combines Ubuntu‘s infrastructure with customizations and unique features for coding, such as automatic tiling window management.

As of February 2023, Pop!_OS holds a 1.18% share of the overall Linux desktop market according to the latest Linux marketshare statistics. However, some estimates suggest up to 10% of individual Linux developers actively use Pop!_OS as their daily driver OS.

Pop!_OS follows Ubuntu‘s kernel update conventions. The standard Pop!_OS kernel version follows Ubuntu LTS kernel branches. Currently that means the 5.19 series kernel for Pop!_OS 22.04 LTS, released in April 2022. Ubuntu backports key kernel updates from newer series to the LTS branch.

Occasionally, bigger jump updates to Pop!_OS kernels coincide with major Pop!_OS releases every 6 months. The next will be version 23.04 in September 2023, likely bringing the 5.20 or even 5.21 kernel.

Understanding this release cycle is helpful context when updating your kernels. Next we‘ll explore methods to actually upgrade kernels.

Checking Your Current Kernel Version

Open a terminal and run:

uname -r

This will print your currently running kernel version:

5.19.0-76051915-generic

Make a note of your kernel version number to check after upgrading.

Updating System Packages

Before upgrading your kernel itself, it‘s good practice to refresh all system packages to latest:

sudo apt update
sudo apt full-upgrade

This ensures other components are updated to versions compatible with the newer kernel.

Using Mainline to Upgrade Kernel

The easiest way to upgrade your Pop!_OS kernel is by using the Mainline graphical utility:

sudo add-apt-repository ppa:cappelikan/ppa  
sudo apt update
sudo apt install mainline

Mainline presents a simple UI showing available kernels from the Ubuntu Mainline PPA maintained by Kernel Ubuntu member Stefan Bader.

Mainline app showing kernel versions

To upgrade, just select a newer kernel from the list and double click to install. Mainline will safely upgrade your kernel while retaining the existing one as fallback.

After Mainline finishes, reboot your system to load the new kernel.

Using APT to Upgrade Kernel

You can also upgrade kernels directly using the APT package manager:

sudo apt install --install-recommends linux-generic-hwe-20.04 

This will fetch the latest Linux kernel available for Ubuntu 20.04 LTS systems and install it alongside your existing one.

Once installation completes, reboot your computer to boot into the new kernel.

Verifying the Updated Kernel Version

After reboot, double check your new running kernel version:

uname -r

5.19.12-76051915-generic

We‘re now on kernel 5.19.12 rather than 5.19.0 – upgrade success!

This same uname -r command is handy to check kernel versions at any time.

Removing Old Kernels

With a kernel upgrade method like Mainline, your old kernel remains installed as a backup option in case issues crop up. However, keeping many old kernels around can clutter up your system over time.

To remove outdated kernels, first list currently installed versions:

dpkg --list | grep linux-image

Sample output showing three kernel versions installed:

ii  linux-image-5.15.0-56-generic          5.15.0-56.62              amd64        Linux kernel image for version 5.15.0 
ii  linux-image-5.19.0-76051915-generic    5.19.0.76051915.2023011    amd64        Linux kernel image 
ii  linux-image-5.19.12-76051915-generic   5.19.12.76051915.20230211  amd64        Linux kernel image

We likely want to remove 5.15 and only keep the latest 5.19.12 and fallback 5.19.0 kernel versions.

Use the purge-old-kernels tool from recommend rockylinux-release-utils to remove old kernels:

sudo apt install rockylinux-release-utils
sudo purge-old-kernels

By default, this removes kernels except the two most recent versions. This helps balance disk space against having an older working fallback kernel.

You can tweak parameters to be more or less aggressive in removing old kernels automatically.

Potential Issues When Upgrading Kernels

Overall, upgrading kernels through trusted methods like Mainline or APT is quite safe and causes few problems. But issues can occasionally crop up:

  • A new kernel may not boot properly requiring booting back into the old kernel
  • Graphical glitches or impaired performance on newer kernels due to outdated GPU drivers
  • Rare hardware compatibility regressions with very new kernels
  • Third party kernel modules failing to build against new kernel APIs

Fortunately, the prior working kernel remains as a backup when using Mainline. And Ubuntu/Pop!_OS kernels are tested extensively against hardware and software before release.

But if issues do arise after a kernel upgrade, solutions include:

  • Booting back into previous kernel version
  • Updating drivers/modules to compatible versions
  • Rolling back kernel upgrade
  • Troubleshooting Hardware Enablement Stack (HWE) problems

Having an older fallback kernel makes diagnosing issues simpler. Multi-kernel support is another reason to manage old kernels instead of hastily removing all vestiges of old ones.

Comparing Pop!_OS Kernel Upgrades to Other Distros

The kernel upgrade experience on Pop!_OS closely parallels that of its parent Ubuntu distribution. Both leverage tools like Mainline and make new kernel versions easily accessible.

Debian, in contrast, has much slower adoption of newer kernel branches. Debians lags multiple LTS kernel versions behind on the same systems where Ubuntu/Pop!_OS offer newer kernels. This comes from Debian‘s overriding stability priorities at the cost of latest updates.

Rolling release distros like Arch Linux present bleeding edge kernel updates immediately as they are released upstream. This caters to enthusiasts but risks destabilizing systems compared to Ubuntu‘s tested, validated staged kernel deployment strategy.

For developers focused on advancing projects rather than tweaking systems, Ubuntu derivatives like Pop!_OS strike a nice balance making recent kernels available without excessive instability risk.

Conclusion

I hope this guide gave you an in-depth understanding of managing kernel updates on Pop!_OS beyond a basic how-to. Keeping up to date Pop!_OS kernels should be part of your routine maintenance as a developer using the distro. Fortunately tools like Mainline make upgrading kernels quite smooth.

Be sure to apply all system package updates before and after kernel upgrades to avoid incompatibilities. Monitor your kernel version with uname -r and periodically remove older kernel versions to clean up unnecessary disk usage.

With this knowledge, you can keep your Pop!_OS system‘s foundation rock solid through prompt kernel upgrades while avoiding stability pitfalls. Let me know in the comments if you have any other questions on managing Pop!_OS kernels!

Similar Posts