Loading...
X

How to downgrade to a previous kernel version in Arch Linux. How to install and switch to linux-lts

New Linux kernels bring support for new hardware and new features. But sometimes the kernel causes problems: it is completely or partially incompatible with existing software, especially video drivers suffer from this, but this can also apply to any other software, for example, VirtualBox.

At the time of the release of the linux 5.9 kernel, NVIDIA drivers were partially incompatible with it, as a result, their important functionality was lost. Although the graphics card worked, but CUDA, OpenCL and probably other features are broken. Of course, this was fixed pretty quickly, but what about those who needed CUDA and OpenCL or other programs that were incompatible with the latest version of the Linux kernel at the time of the problem?

A very recent example, the linux 5.19 kernel at the time of writing is not compatible with the latest version of VirtualBox, which just doesn't work. The problem will be fixed in the near future, but what if you need running VirtualBox machines right now?

One option is to rollback to a previous version by installing it from the downloaded package cache. The method is not the most pleasant, since it will be necessary to prohibit updating the package, the version of which was rolled back, or even refuse to update the entire system.

This method is especially annoying when it comes to the linux kernel – you also need to do something with dependencies.

One of the easier options is to switch to the linux-lts kernel.

How to install linux-lts

LTS – stands for Long Time Support. Simply put, this is a Linux kernel and modules from one of the previous versions, which is rarely updated.

This kernel can be installed as a regular package, replacing the existing kernel. Depending on your computer configuration, you may need to install other *-lts packages, such as the nvidia-lts package, an NVIDIA video driver for the linux-lts kernel.

Also install linux-lts-headers.

All these packages can be installed with the command:

sudo pacman -S linux-lts linux-lts-headers nvidia-lts

Please note that it is not required to remove the old kernel and also the NVIDIA drivers (although you can do this if you wish).

How to switch to linux-lts kernel. Boot options update

In order to use the linux-lts kernel, you need to change the boot options.

Changing boot options is done differently depending on whether you are using GRUB or systemd-boot.

If you are unsure, see “How to check if a computer is using BIOS or UEFI; GRUB or systemd-boot bootloader; MBR or GPT partition table”.

Update boot options for systemd-boot

Open file /boot/loader/entries/arch.conf

sudo vim /boot/loader/entries/arch.conf

Or:

sudo gedit /boot/loader/entries/arch.conf

And replace the lines in it

linux   /vmlinuz-linux
initrd  /initramfs-linux.img

On the

linux   /vmlinuz-linux-lts
initrd  /initramfs-linux-lts.img

For example, the full content of my file was

title	BlackArch
linux   /vmlinuz-linux-lts
initrd  /initramfs-linux-lts.img
options	root=/dev/nvme0n1p2 rw

I commented out the lines that point to the normal kernel version and added the lines that point to linux-lts:

title	BlackArch
#linux	/vmlinuz-linux
#initrd	/initramfs-linux.img
linux   /vmlinuz-linux-lts
initrd  /initramfs-linux-lts.img
options	root=/dev/nvme0n1p2 rw

Then reboot and make sure you are using the LTS kernel version with the command:

uname -a

Update Boot Options for GRUB

Update your GRUB configuration:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Then reboot and make sure you are using the LTS kernel version with the command:

uname -a

After the kernel has been improved and the problems that are bothering you are fixed, you can return to the latest version of the Linux kernel.


Leave Your Observation

Your email address will not be published.