Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
Extraversion    level—This  is  the number  representing    a   collection
of patches and additions made to the kernel by the Ubuntu engineers to
make the kernel work for them (and you). Each collection is numbered,
and the number is indicated here in the kernel name. There is not one in
our preceding example. In the example below, it is 0.

Type uname -r at the command prompt to display your current kernel
version, shown here with sample output:


Click here to view code image
matthew@seymour:~$ uname -r
4.15.3.0-generic


Obtaining the Kernel Sources


The Linux kernel has always been freely available to anyone who wants it. If
you just want to recompile the existing kernel, install the linux-source
package from the Ubuntu repositories. To get the very latest vanilla version
(which is the commonly used term for the kernel version direct from the main
kernel developers and which has not yet been patched or changed by any
distribution-specific kernel team), open an HTTP connection to
https://www.kernel.org/pub/ or use Git to retrieve from https://git.kernel.org
or use RSYNC to retrieve from rsync://rsync.kernel.org/pub/. We will use
kernel 4.15.3 in the following examples.


A number of different entries exist on the archive site for each kernel version,
but because you are interested only in the full kernel, it is necessary to get the
full package of source code (for example, linux-4.15.3.bz2).


The .bz2 extension is applied by the bzip2 utility, which has better
compression than gzip.


After it is downloaded, move the package to a directory other than
/usr/src and unpack it. The bzip2 unpack command is tar -xjvf
linux-4.15.3.tar.bz2. After it is unpacked, the package creates a new
directory, linux-4.15.3. Copy it to /usr/src or move it there. Then
create a symbolic link of linux-4.15 to linux-4.15.3. (Otherwise,
some scripts will not work.) Here is how to create the symbolic link:


Click here to view code image
matthew@seymour:~$ sudo rm /usr/src/linux-4.15
matthew@seymour:~$ sudo ln -s /usr/src/linux-4.15.3 /usr/src/linux-
4.15


By creating a symbolic link to /usr/src/linux-4.15, it is possible to

Free download pdf