Linux kernel 5.0 released and here is how to install it

last updated in Categories Linux News

Linus Torvalds the creator and the principal developer of the Linux kernel announced the release of Linux kernel version 5.0. This release increases the major kernel version number to 5. from 4.x. The new change does not mean anything and does not affect programs in any way. From the mailing list:

Te overall changes for all of the 5.0 release are much bigger. But I’d like to point out (yet again) that we don’t do feature-based releases, and that “5.0” doesn’t mean anything more than that the 4.x numbers started getting big enough that I ran out of fingers and toes.

What’s new in Linux kernel 5.0?

  1. Improvements for Intel i915 GPU Linux driver for tiled display fix
  2. A set of amdgpu/radeon GPU driver fixes
  3. Adiantum encryption system for low powered devices/mobile phone, developed by Google for Android and ChromeOS
  4. Imported Linux container security using the seccomp engine
  5. Better support for CPU bugs such as Spectre and Meltdown for Linux kernel 5
  6. Fixed tun device including blocking read and remove unnecessary memory barrier
  7. Various Linux ARM SoC fixes such as qualcomm msm8998 and others
  8. Networking device fixes such as Memory leak in sit on device registry failure and more
  9. See complete Linux kernel 5 changelog here

How to compile Linux kernel 5.0

Grab the latest Linux 5.0 kernel source code using wget command
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.1.1.tar.xz
Run the xz command to decompress the Linux kernel .xz tar ball file:
xz -d -v linux-5.1.1.tar.xz
OR
unzx -v linux-5.1.1.tar.xz
Download and verify Linux kernel tarball:
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.1.1.tar.sign
gpg --verify linux-5.1.1.tar.sign

Sample outputs:

gpg: Signature made Monday 04 March 2019 12:48:35 PM IST using RSA key ID 6092693E
gpg: Good signature from "Greg Kroah-Hartman {gregkh@linuxfoundation.org}"
gpg:                 aka "Greg Kroah-Hartman {gregkh@kernel.org}"
gpg:                 aka "Greg Kroah-Hartman (Linux kernel stable release signing key) {greg@kroah.com}"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 647F 2865 4894 E3BD 4571  99BE 38DB BDC8 6092 693E

If you do not get “BAD signature” output from the “gpg --verify” command, proceed and extract source code for the Linux kernel using the tar command:
tar xvf linux-5.1.1.tar

How to configure the Linux kernel 5 features and modules

You must configure Linux kernel features. You must also specify which kernel modules (drivers) needed for your system. The task can be overwhelming for a new user. I suggest that you copy existing config file using the cp command:
cd linux-5.0
cp -v /boot/config-$(uname -r) .config

Sample outputs:

'/boot/config-5.0.13-300.fc30.x86_64' -> '.config'

Now we have a primary Linux kernel config file. Next step is to run the make menuconfig command that launches the following screen:
make menuconfig
Linux kernel 5.0 config options
You have to select different options as per your need. Each configuration option has HELP button associated with it. It is easy to remove support for a device driver or option and end up with a broken kernel. For example, if the ext4 driver removed from the kernel configuration file, a system may not boot. When in doubt, leave support in the kernel.

How to compile a Linux Kernel 5.0

Type:
## get thread or cpu core count using nproc command ##
## to speed up compile time ##
make -j $(nproc)

Next, install Linux 5.0 kernel modules, run:
sudo make modules_install
Finally, type the following command to install Linux kernel image itself:
sudo make install
Update grub config as per your Linux distro.

CentOS/RHEL/Oracle/Scientific and Fedora Linux

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo grubby --set-default /boot/vmlinuz-5.0.0

Install Linux kernel 5.0 that is released right now

Debian/Ubuntu/Mint Linux and friends

sudo update-initramfs -c -k 5.0.0
sudo update-grub

Reboot Linux computer and boot into your new kernel

Just issue the reboot command or shutdown command as follows:
sudo reboot
Verify new Linux kernel version after reboot:
$ uname -mrs
Linux 5.0 Finally Released By Linus Torvalds

Conclusion

Configurations! You completed various steps to build the Linux kernel 5.0 from source code and compiled kernel should be running on your system. The mainline kernel release meant for testing and desktop users where you have cutting edge hardware. For servers, compile and install stable Linux Kernel 5.1.xx from source code. See the kernel.org page here for more info.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive