The key point in the question is how to do it securely. I've divided this answer into four sections:
How to find the newest mainline stable Ubuntu kernels
How to download the kernel and checksum files
How to verify checksums
How to install new kernel
How to find the newest mainline stable Ubuntu kernels
Go to https://kernel.ubuntu.com/~kernel-ppa/mainline and click on date modified two times. The first time sorts by date in ascending order, the second time sorts descending. Your newest kernels will be on top:
I'm interested in 4.14.120 which is an LTS (Long Term Support) kernel for five years. I'll click on it and move to the next section:
How to download the kernel and checksum files
I've selected the generic packages for downloading:
In order to allow verification that the published builds are the
builds made by the mainline build system, the individual files are
checksummed and the results of that published as CHECKSUMS in the same
directory. This file is in turn signed by the mainline builder using
the GPG key below which can be obtained from the Ubuntu Keyserver:
The verification can be done by running the following commands:
Import the above public key to your keyring (if you haven't already done that):
$ gpg --keyserver hkps://pgp.mit.edu --recv-key "60AA7B6F30434AE68E569963E50C6A0917C622B0"
Download the CHECKSUMS and CHECKSUMS.gpg files from the build directory and verify if the CHECKSUMS is signed with the above key:
$ gpg --verify CHECKSUMS.gpg CHECKSUMS
gpg: Signature made .... using RSA key ID 17C622B0
gpg: Good signature from "Kernel PPA <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Verify the checksums of downloaded deb files:
$ shasum -c CHECKSUMS 2>&1 | grep 'OK$'
You should get a line ending with "OK" for each of downloaded deb file and each type of checksums that are given in the CHECKSUMS file.
I've edited the CHECKSUMS file and removed irrelevant kernels (ARM, S390, low-latency, Power PC and 32-Bit) to leave only the checksums for files downloaded above:
Note: For some reason the CHECKSUMS file opened up instead of downloading. I had to copy and paste text to manually created file CHECKSUMS.
How to install new kernel
Assuming checksum verification passed change to your downloads directory and install:
cd ~/Downloads # Go to our downloads directory
sudo dpkg -i *.deb # Install all four kernel .deb files downloaded
rm -f *.deb # Clean up so we don't accidentally install next time around
reboot # reboot to grub and select new kernel on Advanced Options
Note don't key in # comments those are for explanation purposes and machine ignores them.
You can download the newest versions of the kernel ready form Ubuntu at https://kernel.ubuntu.com/~kernel-ppa/mainline/
And then use
to install it
Introduction
The key point in the question is how to do it securely. I've divided this answer into four sections:
How to find the newest mainline stable Ubuntu kernels
Go to https://kernel.ubuntu.com/~kernel-ppa/mainline and click on date modified two times. The first time sorts by date in ascending order, the second time sorts descending. Your newest kernels will be on top:
I'm interested in
4.14.120
which is an LTS (Long Term Support) kernel for five years. I'll click on it and move to the next section:How to download the kernel and checksum files
I've selected the generic packages for downloading:
Scroll down further and you will find the
CHECKSUM
files that guarantees what was published is what you actually received:Click both checksums to download them and move onto the next section.
How to verify checksums
After downloading checksum links follow these instructions:
I've edited the
CHECKSUMS
file and removed irrelevant kernels (ARM, S390, low-latency, Power PC and 32-Bit) to leave only the checksums for files downloaded above:Note: For some reason the
CHECKSUMS
file opened up instead of downloading. I had to copy and paste text to manually created fileCHECKSUMS
.How to install new kernel
Assuming checksum verification passed change to your downloads directory and install:
Note don't key in
#
comments those are for explanation purposes and machine ignores them.