6
March
2024
10:32

Updating the Linux kernel using the "mainline" utility or the "ubuntu-mainline-kernel.sh" script

6 March 2024 10:32

Using "mainline" you can update the kernels of Ubuntu 20.04 or 22.04, other OSes to the latest 6.7.8 or 6.8 rc7.

Updating the Linux kernel using mainline

Method No. 1 - mainline utility

Ubuntu Linux and Linux Mint have a tool mainline, which can be installed from the repository http://kernel.ubuntu.com/~kernel-ppa/mainline/

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

mainline install-latest#download and install the latest kernel marked "-rc", "release candidate"

Source:Mainline – Another Tool to Install Latest Kernel in Ubuntu / Linux Mint

Method No. 2 bash script to update the kernel

0) If the nVidia graphics adapter (see output sudo lshw -class Video), there may be problems with it if you use a proprietary (non-free) driver. Before installing a new kernel, change the driver to a compatible one - nVidia Nouveau using Start - Settings - Drivers)

1) Find out the current kernel version

cat /proc/version_signature

2) Download from the Internet from the site and install the bash script "ubuntu-mainline-kernel.sh":

sudo apt install wget
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh 
chmod +x ubuntu-mainline-kernel.sh
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/

2) Before installing mainline, check for the presence of the notify-send command, see the end of the article.

3) Launch mainline. Preparatory stage - with the "-c" switch (from the word check - check)

ubuntu-mainline-kernel.sh -c

4) Installing the latest kernel

sudo ubuntu-mainline-kernel.sh -i

5) Reboot

sudo reboot /t:0   

6) The first item in the menu will be a new kernel. The download will be performed using it. But if it does not happen (the cursor is blinking, etc.) - there is always the opportunity to return to the old kernel in the Grub menu - other boot options.

Source:https://github.com/cheviss/ubuntu-mainline-kernel.sh.


About the notification-daemon service and the notify-send command

The mainline script uses an external command notify-send, like

notify-send test!

Regarding notification-daemon, it is a service that operates at the DBus level and intercepts the output of notifications and displays them in the form of banners in the area of ​​the system tray.

If the notify-send utility does not work, you need to follow 3 simple steps:

1) Reinstall the notification service package (in my case, on the RUNTU LITE operating system) called notification-daemon.

sudo apt reinstall -y notification-daemon

2) Create a service startup file

sudo nano /usr/share/dbus-1/services/org.freedesktop.Notifications.service

contents:

[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemon

3) Check:

notify-send test2!

For more information about the desktop notifications service for various operating systems, see here. The implementation option is not important: the main thing is that the notify-send command works.