Software & AppsOperating SystemLinux

How To Set an Older Kernel Version as Default in Ubuntu 20.04

Ubuntu 11

In this article, we will guide you through the process of setting an older kernel version as the default in Ubuntu 20.04 LTS. This can be useful if you encounter issues with the current kernel and need to revert to a previous version for stability or compatibility reasons.

Quick Answer

To set an older kernel version as the default in Ubuntu 20.04, you can either use the GRUB_SAVEDEFAULT feature or specify the path to the grub menu entry for the desired kernel version. This can be useful if you encounter compatibility issues with the current kernel and need to revert to a previous version for stability.

Understanding the Kernel

The Linux kernel is the core part of any Linux operating system. It is responsible for managing the system’s resources and facilitating communication between your computer’s hardware and software.

Ubuntu, like other Linux distributions, regularly releases new kernel updates. These updates often include security patches, improved hardware compatibility, and new features. However, there might be instances where a newer kernel version may cause issues with certain hardware or software. In such cases, reverting to an older kernel version can help resolve the issue.

Checking Your Current Kernel Version

Before you proceed, it’s important to check the current kernel version of your Ubuntu system. You can do this by opening the Terminal and typing the following command:

uname -r

This command will display the current kernel version that your system is running.

Listing All Installed Kernel Versions

To view all the installed kernel versions on your system, use the following command:

dpkg --list | grep linux-image

This command will list all the installed Linux kernel images.

Setting the Default Kernel Version

There are two methods to set an older kernel version as the default:

  1. Using the GRUB_SAVEDEFAULT feature
  2. Specifying the path to the grub menu entry for the desired kernel version

Method 1: Using the GRUB_SAVEDEFAULT Feature

The GRUB_SAVEDEFAULT feature allows your system to boot with the last kernel you chose during boot. To enable this feature, follow these steps:

  1. Open the Terminal.
  2. Edit the /etc/default/grub file using the command:
sudo vi /etc/default/grub
  1. Locate the line that says GRUB_DEFAULT=0 and change it to GRUB_DEFAULT=saved.
  2. Add a new line GRUB_SAVEDEFAULT=true to enable the GRUB_SAVEDEFAULT feature.
  3. Save the changes to the file by pressing Esc, followed by :, W, and X.
  4. Update Grub by running the command:
sudo update-grub

Method 2: Specifying the Grub Menu Entry

If you want to specify a specific kernel version as the default, you can follow these steps:

  1. Open the Terminal.
  2. Edit the /etc/default/grub file using the command:
sudo vi /etc/default/grub
  1. Find the line that says GRUB_DEFAULT and specify the path to the grub menu entry for the desired kernel version. For example, it could be something like GRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 5.8.0-36-generic'.
  2. Save the changes to the file by pressing Esc, followed by :, W, and X.
  3. Update Grub by running the command:
sudo update-grub

Rebooting Your System

After making these changes, you need to reboot your system. Hold the Shift key when your system comes back up to access the Grub menu. From there, you can choose the kernel version that you have set as the default.

Conclusion

Setting an older kernel version as the default in Ubuntu 20.04 LTS can be a useful workaround for certain hardware or software compatibility issues. By following the steps outlined in this article, you can easily configure your system to boot with a specific kernel version. Always remember to reboot your system after making these changes to ensure they take effect.

How can I check the current kernel version of my Ubuntu system?

You can check the current kernel version by opening the Terminal and typing the command uname -r. This will display the current kernel version that your system is running.

How can I view all the installed kernel versions on my Ubuntu system?

To view all the installed kernel versions on your system, use the command dpkg --list | grep linux-image. This will list all the installed Linux kernel images.

What is the purpose of setting an older kernel version as the default?

Setting an older kernel version as the default can be useful if you encounter issues with the current kernel. Reverting to a previous version can help resolve compatibility or stability issues with certain hardware or software.

How can I enable the `GRUB_SAVEDEFAULT` feature?

To enable the GRUB_SAVEDEFAULT feature, you need to edit the /etc/default/grub file. Locate the line that says GRUB_DEFAULT=0 and change it to GRUB_DEFAULT=saved. Then, add a new line GRUB_SAVEDEFAULT=true. Save the changes and update Grub by running the command sudo update-grub.

How can I specify a specific kernel version as the default?

To specify a specific kernel version as the default, you need to edit the /etc/default/grub file. Find the line that says GRUB_DEFAULT and specify the path to the grub menu entry for the desired kernel version. Save the changes and update Grub by running the command sudo update-grub.

How do I access the Grub menu to choose the default kernel version?

After making the changes to set the default kernel version, you need to reboot your system. Hold the Shift key when your system comes back up to access the Grub menu. From there, you can choose the kernel version that you have set as the default.

Leave a Comment

Your email address will not be published. Required fields are marked *