14

I am currently on ubuntu 22.04 LTS release which comes with kernel version 5.15.0-27-generic. I want to downgrade to kernel version 5.13 because of touchpad problem in my lenovo thinkbook.

Is it possible to downgrade the baked in kernel in 22.04 LTS release? If yes, how do I achieve it?

3 Answers3

17

You can try below actions to use pimlie / ubuntu-mainline-kernel.sh:

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

search and find your wanted version

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

install that version kernel

ubuntu-mainline-kernel.sh -i v5.13.19

get all menuentries

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

change the grub configuration

vi /etc/default/grub from: GRUB_DEFAULT=0 to: GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.13.19-051319-generic"

update grub

update-grub

reboot

reboot now

verify

uname -r

3

I have updated this answer by @xiaojueguan.

Changes in comparison with that answer:

  • add a variable to define the kernel version to use;
  • use curl instead of wget;
  • get the oldest kernel version Grub entry name programmatically;
  • update the Grub config programmatically;
  • disable upgrading the Linux kernel packages.
# Choose kernel version to install
kernel_version='6.5.0'

Install the old kernel

curl -sL https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh | bash -s -- -i "v$kernel_version"

Get the Grub entry name

Note: Do verify the value of grub_entry_name. The following command gets

the oldest kernel version Grub entry name that is not a recovery mode.

Example value: Ubuntu, with Linux 6.5.0-45-generic

grub_entry_name="$(grep -Po "menuentry '\KUbuntu, [^(']+" /boot/grub/grub.cfg | sort -V | head -1)"

Update grub

sed -i "s/^\sGRUB_DEFAULT=.$/GRUB_DEFAULT='Advanced options for Ubuntu>$grub_entry_name'/" /etc/default/grub update-grub

Disable the kernel package upgrade

apt-mark hold $(dpkg --get-selections | grep -Po "^linux[^\t]+${grub_entry_name##* }")

Reboot system

reboot

Check the currently booted Linux kernel version

uname -r

0

In my case, after clean install of lubuntu-22 on Dell-Inspiron_5570, experienced "elantech touchpad problem" due to which "two finger scrolling" was not working. After 4-5 hectic days on the work dealing with the arrow keys on keyboard, I found it as kernel incompatibility. Then, tried installing different kernel versions following @xiaojueguan answer and found the version 5.15.0-58-generic to be working for me.