How to install / upgrade to Linux Kernel 4.12.1 in Ubuntu 16.04

How to install / upgrade to Linux Kernel 4.12.1 in Ubuntu 16.04

A Linux kernel is the essential part of any Linux operating system. It is responsible for resource allocation, low-level hardware interfaces, security, simple communications, basic file system management, and more. Linux is actually a clone of the UNIX operating system. It is geared towards POSIX and Single UNIX Specification compliances. This article will cover the ground on how to install or upgrade to Linux Kernel 4.12.1 in Ubuntu 16.04.

Installation procedure

For 64-bit system

Before updating the kernel, first check the version of the installed kernel in the target system by using the uname command

root@linuxhelp:~# uname -r
Linux 4.4.0-27-generic

Next, choose any directory and place all your .deb files in that directory by running the following command.

root@linuxhelp:~# cd /tmp
root@linuxhelp:/tmp#

Now download the required set of kernel file by executing the wget command.

root@linuxhelp:/tmp# wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-wily/linux-headers-4.12.1-040500_4.12.1-040500.201603140130_all.deb
--2016-07-12 13:21:13--  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-wily/linux-headers-4.12.1-040500_4.12.1-040500.201603140130_all.deb
Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 91.189.94.216
Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|91.189.94.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9772348 (9.3M) [application/x-debian-package]
Saving to: ‘ linux-headers-4.12.1-040500_4.12.1-040500.201603140130_all.deb’ 
100%[=======================================> ] 97,72,348    396KB/s   in 17s    

2016-07-12 13:21:31 (554 KB/s) - ‘ linux-headers-4.12.1-040500_4.12.1-040500.201603140130_all.deb’  saved [9772348/9772348]

root@linuxhelp:/tmp# wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-wily/linux-headers-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb
--2016-07-12 13:23:00--  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-wily/linux-headers-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb
Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 91.189.94.216
Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|91.189.94.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 780458 (762K) [application/x-debian-package]
Saving to: ‘ linux-headers-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb’ 
100%[=======================================> ] 7,80,458     251KB/s   in 3.0s   

2016-07-12 13:23:03 (251 KB/s) - ‘ linux-headers-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb’  saved [780458/780458]
root@linuxhelp:/tmp #

root@linuxhelp:/tmp# wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-wily/linux-image-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb
--2016-07-12 13:23:19--  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-wily/linux-image-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb
Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 91.189.94.216
Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|91.189.94.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 56160474 (54M) [application/x-debian-package]
Saving to: ‘ linux-image-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb’ 

100%[=======================================> ] 5,61,60,474  472KB/s   in 1m 55s
2016-07-12 13:25:15 (478 KB/s) - ‘ linux-image-4.12.1-040500-generic_4.12.1-040500.201603140130_amd64.deb’  saved [56160474/56160474]

After downloading the set of files, we need to install the debian files in the target system using the dpkg command.

root@linuxhelp:/tmp# dpkg -i *.deb
Selecting previously unselected package linux-headers-4.5.0-040500.
(Reading database ... 165882 files and directories currently installed.)
Preparing to unpack linux-headers-4.12.1-040500_4.12.1-040500.201603140130_all.deb ...
Unpacking linux-headers-4.12.1-040500 (4.5.0-040500.201603140130) ...
Selecting previously unselected package linux-headers-4.12.1-040500-generic.
.
.
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
done

The package has been installed in the system. It will reboot automatically after installing the kernel.

root@linuxhelp:/tmp# init 6
The system is going down for reboot NOW!

To check the kernel version that we have updated in our system, execute the following command. The latest version is shown.

root@linuxhelp:~# uname -r
4.12.1-041201-generic

The installation and upgrade process of the Linux kernel in Ubuntu is successfully done.

FAQ
Q
How Can I get an account on kernel.org?
A
Kernel.org accounts are usually reserved for subsystem maintainers or high-profile developers. It is absolutely not necessary to have an account on kernel.org to contribute to the development of the Linux kernel, unless you submit pull requests directly to Linux.
Q
How does kernel.org provide its users access to the git trees?
A
We chose gitolite for a number of reasons:

Limiting of ssh access to the system
Fine grained control over repository access
Q
Is Linux Kernel Free Software?
A
Linux kernel is released under GNU GPL version 2 and is therefore Free Software as defined by the Free Software Foundation. You may read the entire copy of the license in the COPYING file distributed with each release of the Linux kernel.
Q
What does "stable/EOL" and "longterm" mean in Linux kernal?
A
As kernels move from the "mainline" into the "stable" category, two things can happen:

They can reach "End of Life" after a few bugfix revisions, which means that kernel maintainers will release no more bugfixes for this kernel version, or
They can be put into "longterm" maintenance, which means that maintainers will provide bugfixes for this kernel revision for a much longer period of time
Q
Why are there files that are dated tomorrow?
A
All timestamps on kernel.org are in UTC (Coordinated Universal Time). If you live in the western hemisphere your local time lags behind UTC. Under Linux/Unix, type date -u to get the current time in UTC.