Install a new Linux kernel on Ubuntu.

If you are a Ubuntu user and interested in getting the latest features and improvements of the Linux kernel, then installing a new kernel might be an excellent option for you. In addition to providing performance and stability improvements, updating the kernel can also be beneficial for the security of your operating system.
Disclaimer: The procedures mentioned in this post may involve certain risks to the proper functioning of your operating system. Therefore, it is recommended that you follow the steps with caution and at your own risk. Make sure to have an updated backup of all important data before continuing.
Download
Before being able to install a new kernel in Ubuntu, the first thing you should do is download the kernel packages from the corresponding source. At this stage of the process, it is important to select the correct version of the kernel you want to install and download the necessary files for the installation.
You can find any version of the kernel at the following link:
- https://kernel.ubuntu.com/~kernel-ppa/mainline/
At this moment, the latest version of the Kernel is v6.2.14, therefore the download will be available at:
- https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.2.14/
You must choose the appropriate version according to your PC's architecture, you can copy the download link, or download the files directly from the browser. I'll do it from the terminal, for version 6.2.14 I'll download the following files.
export WEB=https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.2.14/amd64
export KERNEL=linux-headers-6.2.14-060214_6.2.14-060214.202305010032_all.deb
export GENERIC=linux-headers-6.2.14-060214-generic_6.2.14-060214.202305010032_amd64.deb
export MODULES=linux-modules-6.2.14-060214-generic_6.2.14-060214.202305010032_amd64.deb
export UNSIGNED=linux-image-unsigned-6.2.14-060214-generic_6.2.14-060214.202305010032_amd64.deb
wget $WEB/$KERNEL
wget $WEB/$GENERIC
wget $WEB/$MODULES
wget $WEB/$UNSIGNED
Installation
Once the kernel files are downloaded, we can proceed to install them.
dpkg -i $KERNEL $GENERIC $MODULES $UNSIGNED
Finally, we must update the GRUB.
sudo grub-mkconfig -o /boot/grub/grub.cfg
update-grub