2 utilities (GUI and command line) to install the latest kernel in Ubuntu or Linux Mint

After the regular Ubuntu version is released, you will usually not receive new major kernel version updates. For LTS versions, such as Ubuntu 18.04, there are LTS enable stack They provide newer kernels and Xorg upgrades, but it will take a while to release.
For example, Ubuntu 18.04 should Receive updated kernels around February 2019.
If you want to install newer kernels than those available in Ubuntu due to some new important features, better hardware support, etc., or if they solve some of the key problems you encounter with the default Ubuntu kernel Some devices are not working properly, you can use Mainline core PPA.
This is not the actual PPA, you can add it to the system like the launchpad PPA, but you need to manually download and install the DEB package. To make this process easier and selectively inform you when a new kernel is provided in Mainline PPA, you can use a variety of tools. This article introduces two such tools, one using a graphical user interface and the other. From the command line. These two utilities not only support Ubuntu, but also support Ubuntu-based Linux distributions (such as Linux Mint).

Warning-please read before updating the kernel

Before installing anything, you should know that usually installing a mainline kernel on an Ubuntu computer is not a good idea. These kernels are built from the latest Linux sources without any Ubuntu patches or any other modifications and are therefore not supported.
Moreover, installing the kernel from the Mainline Kernel PPA usually destroys proprietary drivers or modules outside the tree, such as proprietary Nvidia graphics drivers, Broadcom wireless drivers, VirtualBox dkms modules, and so on. As a result, your computer may boot to a black screen, you may experience random crashes, and / or after installing and booting to the mainline kernel, WiFi may not work properly.
For example, I installed the latest Linux 4.19 while installing the Nvidia 396.54 graphics driver, and the Nvidia module could not be built. Fortunately, Nvidia Graphics PPA has a newer driver version that supports Linux 4.19-Nvidia 410, so I installed this version to solve the problem. However, if Nvidia 410 is not released, or my graphics card does not support the latest version of PPA drivers, my computer will boot to a black screen using the 4.19 kernel (otherwise, I must delete the proprietary Nvidia driver and use Nouveau) . In other words, using these tools to install the latest kernel from Ubuntu Kernel PPA is at your own risk!

Update the kernel in Ubuntu or Linux Mint using a GUI utility called Mainline

Ubuntu Mainline kernel installer[[Edit] kuOr Ubuntu Kernel Update Utility is no longer free to use, so in this article I will replace it with Main line, Is a continuation of free Ukuu.
Mainline (or “Ubuntu Mainline Kernel Installer”) is a tool for installing the latest Mainline kernel on Ubuntu-based distributions.
The application displays a list of kernels available in Ubuntu Mainline Kernel PPA, making it easy for users to download and install the required version. Using it, you can also remove the mainline kernel installed with this utility, and view changes in the kernel version.
When a new kernel is available, it can also display notifications, and the GRUB menu timeout can be changed from its settings. This is useful if you want to use the old kernel to prevent problems with the newly installed kernel.
Mainline can Downloaded From its project page, you can also install using PPA:

sudo apt-add-repository -y ppa:cappelikan/ppa
sudo apt update
sudo apt install mainline

Now you can start Mainline, select the Linux version to install, and click Install Button. A new window will pop up showing what is happening under the hood, such as downloading and installing the kernel deb:Install the latest mainline kernel in Ubuntu Linux

Use ubuntu-mainline-kernel.sh to update the kernel in Ubuntu or Linux Mint from the command line

ubuntu-mainline-kernel.sh It is a Bash script that can easily install the kernel from the Ubuntu kernel PPA.
The command line tool also allows to remove the installed kernel from the Ubuntu kernel PPA, it can check if there is a newer kernel version, list locally installed kernel versions and search and list available kernel versions. It can only download deb files without installing them.
Moreover, compared to Ukuu, this console tool also allows the installation of a low-latency version of the kernel (which can reduce latency and is useful for audio recording, for example, but it saves power), only for amd64 and i386 and Install a large physical address expansion kernel, which is only applicable to armhf.
In general, it is recommended that you check out the code used in this script and any other scripts you run on the system, and only run them if you have at least a basic understanding of their purpose.
You can install the ubuntu-mainline-kernel.sh script to /usr/local/bin/ Use the following command:

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

sudo install ubuntu-mainline-kernel.sh /usr/local/bin/

The ubuntu-mainline-kernel.sh project also includes a desktop file that you can add to the startup to automatically check for a new kernel version when you log in. This is optional, if you need this feature, you can use the following command to install (libnotify-bin Display desktop notification when a new version is required):

sudo apt install libnotify-bin

wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/UbuntuMainlineKernel.desktop

mv UbuntuMainlineKernel.desktop ~/.config/autostart/

Now you can start using ubuntu-mainline-kernel.sh. Use the following command to check the latest available kernel version from Ubuntu kernel PPA -c:

ubuntu-mainline-kernel.sh -c

To install the kernel version, use -i version,E.g -i 4.9, like this:

sudo ubuntu-mainline-kernel.sh -i 4.9

Or simply use -i Install the latest available version. It looks like this:

$ sudo ubuntu-mainline-kernel.sh -i
Finding latest version available on kernel.ubuntu.com
Latest version is: v4.19.0, continue? (y/N) 
Will download 6 files from kernel.ubuntu.com:
Downloading CHECKSUMS: 100%   
Downloading CHECKSUMS.gpg: 100%   
Downloading linux-headers-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb: 100%   
Downloading linux-headers-4.19.0-041900_4.19.0-041900.201810221809_all.deb: 100%   
Downloading linux-image-unsigned-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb: 100%   
Downloading linux-modules-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb: 100%   
Signature of checksum file has been succesfully verified
Checksums of deb files have been succesfully verified with sha256sum
Installing 4 packages
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-041900-generic
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.0-041900-generic
Found initrd image: /boot/initrd.img-4.19.0-041900-generic
Found linux image: /boot/vmlinuz-4.18.0-10-generic
Found initrd image: /boot/initrd.img-4.18.0-10-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Cleaning up work folder

All available options:

ubuntu-mainline-kernel.sh -h
Usage: /usr/local/bin/ubuntu-mainline-kernel.sh -c|-l|-r|-u

Download & install the latest kernel available from kernel.ubuntu.com

Arguments:
  -c               Check if a newer kernel version is available
  -i [VERSION]     Install kernel VERSION, see -l for list. You dont have to prefix
                   with v. E.g. -i 4.9 is the same as -i v4.9. If version is
                   omitted the latest available version will be installed
  -l [SEARCH]      List locally installedkernel versions. If an argument to this
                   option is supplied it will search for that
  -r [SEARCH]      List available kernel versions. If an argument to this option
                   is supplied it will search for that
  -u [VERSION]     Uninstall the specified kernel version. If version is omitted,
                   a list of max 10 installed kernel versions is displayed
  -h               Show this message

Optional:
  -s, --signed         Only install signed kernel packages (not implemented)
  -p, --path DIR       The working directory, .deb files will be downloaded into 
                       this folder. If omitted, the folder /tmp/ubuntu-mainline-kernel.sh/ 
                       is used. Path is relative from $PWD
  -ll, --low-latency   Use the low-latency version of the kernel, only for amd64 & i386
  -lpae, --lpae        Use the Large Physical Address Extension kernel, only for armhf
  -do, --download-only Only download the deb files, do not install them
  -ns, --no-signature  Do not check the gpg signature of the checksums file
  -nc, --no-checksum   Do not check the sha checksums of the .deb files
  -d, --debug          Show debug information, all internal command's echo their output
  --rc                 Also include release candidates
  --yes                Assume yes on all questions (use with caution!)

How to recover from a damaged kernel installation

If your computer boots to a black screen after upgrading the kernel, freezes or does not work properly, please reboot and select Ubuntu’s “Advanced” option from the GRUB menu:Ubuntu Grub2 menu

Then select the previous kernel version and click Enter:2 utilities (GUI and command line) to install the latest kernel in Ubuntu or Linux Mint

For whatever reason, if you want to uninstall the latest kernel, you need to boot to the previous kernel version. That is because you cannot delete the kernel that is currently in use.
If you ca n’t see the GRUB2 menu, press and hold Shift Or press Esc When loading GRUB, press the keys repeatedly (this may depend on the BIOS or UEFI boot and the Ubuntu / Linux Mint version used). The Grub menu will be displayed, allowing you to select the previous kernel version.
By the way, Ukuu can set the GRUB menu in the GRUB menu timeout setting to display it at startup without pressing any keys.
After booting to the previous kernel, you can delete the faulty kernel. Both Ukuu and ubuntu-mainline-kernel.sh allow the removal of installed kernels from the Ubuntu kernel PPA.
To use Ukuu to delete the kernel, select the Linux version to delete and click Remove Button.
Using ubuntu-mainline-kernel.sh, you can uninstall the kernel version by running the following command:

ubuntu-mainline-kernel.sh -u VERSION

Where version is the kernel version, for example 4.9. You can also use -u Without specifying a version, in this case, the tool will list up to 10 kernel versions and ask which version you want to delete. It is worth noting that ubuntu-mainline-kernel.sh will not list the official Ubuntu kernel.

Source

Sidebar