Software & AppsOperating SystemLinux

How To Downgrade Kernel in Ubuntu 22.04 LTS for Touchpad Issue

Ubuntu 10

In this article, we will guide you through the process of downgrading the kernel in Ubuntu 22.04 LTS to resolve touchpad issues. This process can be particularly useful if you’re experiencing problems with your touchpad on a Lenovo ThinkBook and wish to downgrade to a more stable kernel version, such as 5.13.

Please note: Downgrading the kernel may have implications for system stability and security. Always thoroughly test the new kernel version before relying on it for production use. Additionally, ensure you backup your important data before proceeding with any kernel modifications.

Step 1: Download and Make Kernel Installation Script Executable

Open a terminal and run the following commands to download and make the kernel installation script executable:

wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
chmod +x ubuntu-mainline-kernel.sh

The wget command is used to download files from the web. In this case, we’re downloading a script that will help us install the desired kernel version. The chmod +x command is used to make the downloaded script executable.

Step 2: Search for the Desired Kernel Version

Use the script to search for the desired kernel version:

./ubuntu-mainline-kernel.sh -r | grep 5.13

This command will display the available kernel versions starting with “5.13”. The grep command is used to filter the output based on the given pattern.

Step 3: Install the Desired Kernel Version

Install the desired kernel version:

./ubuntu-mainline-kernel.sh -i v5.13.x

Replace “v5.13.x” with the specific version you want to install. This command uses the script we downloaded earlier to install the specified kernel version.

Step 4: List All Menu Entries in the GRUB Bootloader

Get a list of all menu entries in the GRUB bootloader:

grep 'menuentry \|submenu ' /boot/grub/grub.cfg | cut -f2 -d "'"

This command will display the available menu entries. We will use this information in the next step to configure GRUB to boot using the newly installed kernel version.

Step 5: Edit the GRUB Configuration File

Edit the GRUB configuration file:

sudo vi /etc/default/grub

Change the line GRUB_DEFAULT=0 to GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.13.x-generic", replacing “5.13.x” with the specific version you installed. This will set the default boot entry to the specified kernel version.

Step 6: Update GRUB

Update GRUB:

sudo update-grub

This command is used to generate the GRUB configuration file based on the settings in /etc/default/grub.

Step 7: Reboot Your System

Reboot your system:

sudo reboot now

This command will restart your system. Upon reboot, the system should start up using the newly installed kernel version.

Step 8: Verify the Kernel Version

After rebooting, verify that the kernel has been downgraded:

uname -r

This should display the version you installed (e.g., “5.13.x”). The uname -r command is used to display the current kernel version.

If you encounter any issues during the process, such as “error: bad shim signature” or other errors, you may need to disable secure boot in your BIOS settings.

As an alternative, consider using Ubuntu 20.04 LTS, which has long-term support until 2025. This version may be more compatible with older hardware and could potentially resolve the touchpad problem without the need for a kernel downgrade.

We hope this guide has been helpful in addressing your touchpad issue by downgrading the kernel in Ubuntu 22.04 LTS. If you have any further queries, feel free to reach out to us.

Is it safe to downgrade the kernel in Ubuntu 22.04 LTS?

Downgrading the kernel may have implications for system stability and security. Always thoroughly test the new kernel version before relying on it for production use. Additionally, ensure you backup your important data before proceeding with any kernel modifications.

How can I download and make the kernel installation script executable?

To download and make the kernel installation script executable, open a terminal and run the following commands:

wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
chmod +x ubuntu-mainline-kernel.sh
How can I search for the desired kernel version?

You can use the script to search for the desired kernel version by running the following command:

./ubuntu-mainline-kernel.sh -r | grep 5.13

This command will display the available kernel versions starting with "5.13". The grep command is used to filter the output based on the given pattern.

How do I install the desired kernel version?

To install the desired kernel version, use the following command:

./ubuntu-mainline-kernel.sh -i v5.13.x

Replace "v5.13.x" with the specific version you want to install. This command uses the script we downloaded earlier to install the specified kernel version.

How can I list all menu entries in the GRUB bootloader?

To get a list of all menu entries in the GRUB bootloader, run the following command:

grep 'menuentry \|submenu ' /boot/grub/grub.cfg | cut -f2 -d "'"

This command will display the available menu entries. We will use this information in the next step to configure GRUB to boot using the newly installed kernel version.

How do I edit the GRUB configuration file?

To edit the GRUB configuration file, run the following command:

sudo vi /etc/default/grub

This will open the GRUB configuration file in the vi text editor. Change the line GRUB_DEFAULT=0 to GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.13.x-generic", replacing "5.13.x" with the specific version you installed. This will set the default boot entry to the specified kernel version.

How can I update GRUB?

To update GRUB, run the following command:

sudo update-grub

This command is used to generate the GRUB configuration file based on the settings in /etc/default/grub.

How do I reboot my system?

To reboot your system, run the following command:

sudo reboot now

This command will restart your system. Upon reboot, the system should start up using the newly installed kernel version.

How can I verify the kernel version after rebooting?

After rebooting, you can verify the kernel version by running the following command:

uname -r

This should display the version you installed (e.g., "5.13.x"). The uname -r command is used to display the current kernel version.

What should I do if I encounter errors during the process?

If you encounter any issues during the process, such as "error: bad shim signature" or other errors, you may need to disable secure boot in your BIOS settings.

Leave a Comment

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