Linux install kernel version

How to install the latest/stable version of Linux kernel on Ubuntu Linux using apt-get

Method #1: Search and install the latest stable version

I tested this method on the following version of Ubuntu:

To find out your current version of Linux kernel, run:
$ uname -mrs
Linux 4.4.0-83-generic x86_64
To find out the latest version of Linux kernel type:
$ apt-cache search linux-generic
Sample outputs:

The highest possible version is 4.10.0-27. To install it just type the following apt-get command/apt command:
$ sudo apt install linux-image-4.10.0-27-generic
OR
$ sudo apt-get install linux-image-4.10.0-27-generic
Sample outputs:

You must reboot the Linux server, run:
$ rm *.deb
$ sudo reboot
Verify new version:
$ uname -mrs
Linux 4.10.0-27-generic x86_64

Method #2: Install mainline kernel version v4.12.3

First, if one is using select proprietary or out-of-tree modules (ex. vitualbox, nvidia, fglrx, bcmwl, etc.) unless there is an extra package available for the version you are testing, you will need to uninstall the module first, in order to test the mainline kernel. If you do not uninstall these modules first, then the upstream kernel more than likely will not boot.

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

First visit kernel.org and note down the latest kernel version:

Fig.01: Note down kernel version

Fig.02: Downloading the latest build of mainline kernel

kernel-ppa/mainline/v4.12.3/linux-headers-4.12.3-041203-generic_4.12.3-041203.201707210343_amd64.deb
$ wget http://kernel.ubuntu.com/

kernel-ppa/mainline/v4.12.3/linux-image-4.12.3-041203-generic_4.12.3-041203.201707210343_amd64.deb
To verify the mainline build binaries, run:
$ wget http://kernel.ubuntu.com/

kernel-ppa/mainline/v4.12.3/CHECKSUMS
$ sha256sum —ignore-missing -c CHECKSUMS
Sample outputs:

You must see OK for all downloaded .deb files. Next, you need to install .deb files using dpkg command:
$ sudo dpkg -i *.deb
You must reboot the Linux server, run:
$ sudo reboot
Verify new version:
$ uname -mrs
Linux 4.12.3 -041203-generic x86_64

A note about updating mainline kernel

You must visit and download the latest version from the following url:
http://kernel.ubuntu.com/

kernel-ppa/mainline/
For example, download v4.13-rc1 as follows:
$ rm *.deb
$ wget http://kernel.ubuntu.com/

kernel-ppa/mainline/v4.13-rc1/linux-headers-4.13.0-041300rc1-generic_4.13.0-041300rc1.201707151931_amd64.deb
$ wget http://kernel.ubuntu.com/

kernel-ppa/mainline/v4.13-rc1/linux-image-4.13.0-041300rc1-generic_4.13.0-041300rc1.201707151931_amd64.deb
$ wget http://kernel.ubuntu.com/

kernel-ppa/mainline/v4.12.3/CHECKSUMS
$ sha256sum —ignore-missing -c CHECKSUMS
$ sudo dpkg -i *.deb
$ sudo reboot
$ uname -mrs

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

You don’t have Docker support with this kernel version (v4.12.3).

If you install version 4.10.0-27, Docker will work well.

Hi,
About the method #1…
According to [1] and [2], in order to get a kernel as newer as possible in a most convenient way, you should install “linux-signed-generic-lts-XXX” (e.g., “linux-signed-generic-lts-xenial”) or unsigned version “linux-generic-lts-XXX” (e.g., “linux-generic-lts-xenial”) for Ubuntu before LTS 16.04, even prefer to install the newer “linux-signed-generic-hwe-16.04” or even more bleeding edge “linux-signed-generic-hwe-16.04-edge” for Ubuntu LTS 16.04 and newer; instead of specifying a version of linux kernel image package which won’t be automatically updated via “apt update/upgrade”. In this way, it will keep your kernel up to date as possible.

Some example commands to find out the proper kernel package name in Ubuntu:

$ apt-cache search linux-signed-generic-lts
linux-signed-generic-lts-utopic — Complete Signed Generic Linux kernel and headers (dummy transitional package)
linux-signed-generic-lts-vivid — Complete Signed Generic Linux kernel and headers (dummy transitional package)
linux-signed-generic-lts-wily — Complete Signed Generic Linux kernel and headers (dummy transitional package)
linux-signed-generic-lts-xenial — Complete Signed Generic Linux kernel and headers (dummy transitional package)
AND
$ apt-cache search linux-generic-lts
linux-generic-lts-utopic — Complete Generic Linux kernel and headers (dummy transitional package)
linux-generic-lts-vivid — Complete Generic Linux kernel and headers (dummy transitional package)
linux-generic-lts-wily — Complete Generic Linux kernel and headers (dummy transitional package)
linux-generic-lts-xenial — Complete Generic Linux kernel and headers (dummy transitional package)
AND
$ apt-cache search linux-signed-generic-hwe
linux-signed-generic-hwe-16.04 — Complete Signed Generic Linux kernel and headers
linux-signed-generic-hwe-16.04-edge — Complete Signed Generic Linux kernel and headers
$ apt-cache search linux-generic-hwe
linux-generic-hwe-16.04 — Complete Generic Linux kernel and headers
linux-generic-hwe-16.04-edge — Complete Generic Linux kernel and headers

Thanks for the article! I never leave comments but this was useful

Источник

How to Install the Latest Mainline Linux Kernel Version in Ubuntu [GUI and Terminal Methods]

Last updated October 29, 2020 By Abhishek Prakash 54 Comments

This article shows you how to upgrade to the latest Linux kernel in Ubuntu. There are two methods discussed. One is manually installing new kernel and the other uses a GUI tool providing even easier way.

I am assuming that you already know what is Linux kernel. This is the core software that drives any Linux distribution. This is what Linus Torvalds created around 30 years ago and this is what he still works on.

A newer version of Linux kernel is released every few months with new features (such as support for more hardware), bug fixes etc.

But most Linux distribution does not provide the latest Linux kernel unless you are using an Arch-based distribution or some other rolling release distribution.

Linux distributions are responsible for your system’s stability and this is why they don’t release a newer version of Linux Kernel to its users unless they test it for regression on their end. They often use a specific kernel release as base and provide you updates on this base kernel, instead of giving you the latest mainline kernel.

This does not mean that you cannot use the latest Linux kernel in Ubuntu or other distribution you are using.

In this tutorial, I’ll discuss various ways to get a new Linux kernel on Ubuntu.

Using the latest Linux kernel version in Ubuntu: Things you should know

In my opinion, there is no ‘real’ need of upgrading to a newer Linux kernel unless it provides you a good enough reason.

Why install a new Linux kernel version manually?

What could be such a reason? Well, suppose the new Linux kernel introduces support for your sound card or Wi-Fi card or some other hardware component. You read some official forum that the problem you are having with the hardware component could be fixed with a newer Linux kernel version.

HWE kernel option is also available

You should also keep in mind that Ubuntu has this hardware stack enablement (HWE) feature that lets you use somewhat newer Linux kernel on an Ubuntu LTS release.

Older kernels remain available

Another thing to note here is that installing a new kernel doesn’t mean that the older kernel has been removed from the system. It remains at your disposal. By default, Ubuntu boots into the newest Linux Kernel installed on the system.

Two ways of installing new kernel in Ubuntu: Command line and GUI

There are two ways to install newer Linux kernel:

The GUI tool Ukuu is not open source anymore and it locks a few feature which I have discussed in its section.

Let’s see the methods.

Method 1: Manually install new Linux kernel in Ubuntu using command line

The latest Linux kernel is called mainline Linux kernel. You’ll see this term used often.

I must warn you that you should be aware of the risk. If something goes wrong, you may revert to a previous Kernel version but you must not panic. Make a backup of Ubuntu system to be sure. If you are easily baffled with troubleshooting, avoid playing with manual upgrades and stick to your distribution’s system updates.

Step 1: Check current installed version

You may want to first check current installed version of kernel. You can do this by using the uname command in the terminal:

As you can see in output below, I have kernel version 5.4 installed.

Step 2: Download the mainline Linux kernel of your choice

Now you have to download the desired kernel build provided Ubuntu from here.

You can see kernel list like this. I am going to download kernel 5.7. You also should keep in mind to install the stable kernel instead of rc (release candidate).

Now download appropriate kernel files for your architecture. For 64 bit architecture, you should download these kind of files

  • linux-headers-VERSION-NUMBER_all.deb
  • linux-headers-VERSION-NUMBER_amd64.deb
  • linux-image-VERSION-NUMBER_amd64.deb
  • linux-modules-VERSION-NUMBER_amd64.deb

Hence I will download these files:

Step 4: Install the downloaded kernel

Now it’s time to install downloaded kernel. First do into the directory where you’ve downloaded kernel and enter following command. Make sure there isn’t any other “.deb” file in that directory other than downloaded kernel files.

sudo dpkg -i *.deb

It will take some time. After installation finished, you will see screen like this.

Step 5: Reboot Ubuntu and enjoy the new Linux kernel.

Now you’ve installed new kernel in Ubuntu successfully, it’s time to reboot the machine. Ubuntu by default boots into the newer kernel version.

After rebooting, check kernel version with same uname -sr command you used earlier. As you can see, it’s updated to 5.7.0.

Rollback the changes and downgrade Linux kernel

If you didn’t like new Linux Kernel or if you discovered issues with it. You can easily downgrade the Kernel. You just have to:

  • Boot into an older kernel
  • Remove the newer Linux kernel you don’t want

Let’s see how to do that.

When you are booting into your system, on the grub menu, select the Advanced options for Ubuntu.

If you do not see the grub menu, try holding the shift key or use Esc key to bring the grub menu.

In here, you’ll see all the Linux kernels installed on your system. Select an older one. Don’t choose the recovery mode, just go with the normal ones.

Now that you have booted into your good old kernel, we have to remove new kernel.

You can use the apt or dpkg command to remove the installed kernel version. Do you remember the version of new kernel you installed manually? For me it was kernel 5.7. So here’s what I use to delete it.

Change the commands with the version you want to install:

You can see, I have two packages associating with kernel 5.7.0. If I remove the first package it will automatically remove all it’s related dependencies.

Install New Linux Kernel 10

Method 2: Upgrade Linux Kernel in Ubuntu Ukuu GUI tool

You can upgrade Linux kernel on your own in Linux command line. But the kernel upgrade procedure is much easier and more convenient with a GUI tool called Ukuu (Ubuntu Kernel Update Utility).

This GUI tool is developed by Tony George who has provided us with several other useful tools for Ubuntu such as battery monitor for Ubuntu, app backup tool Aptik etc.

You should know that Ukuu of version above 18.9 is now paid and closed source. Version 18.9 is still free and open source.

Paid version contains additional features like:

  • Downloading and installing newer kernel versions automatically
  • Deleting downloaded packages after install
  • Option to stay on same series of a kernel release
  • Automatically removing older kernels.
  • UI improvements.

If you want the additional features, you can purchase it from developer’s official website. Ukuu free version can still be used for installing and removing kernels, though.

Step 1: Install Ukuu in Ubuntu

You can download the deb files for the old Ukuu version 18.9 which is free to use but not updated lately.

Step 2: Install kernel with Ukuu

Once you have installed Ukuu, start it. It will refresh the list of available Linux kernels available for Ubuntu.

By default, it will show you all the available kernels, including the unstable release kernel (tagged with RC and with red Tux icon).

Kernel versions from the distributions are labeled with the logo and the other versions have just the good old Tux logo.

As you can see I have kernel 5.7.0 installed already, now I will install kernel 5.7.1 using Ukuu.

Again, you should avoid the release candidates. Select the desired Kernel version and click on install to install the newer Linux kernel version.

Of course, it will require admin password for this action. Once you have entered your password, you can see the installation progress in the application itself. Focus on the end result to know if it new Linux kernel was installed successfully or not.

Note: If the installation fails, no need to panic. Nothing will be wrong the system. Just try a different Kernel version and it might work.

You should see something like this when installation finished successfully.

Once installation finishes, you’ll see a very helpful screen that tells you if anything goes wrong with the new Linux kernel, you can always choose to boot into the older kernel from the grub menu.

When you boot into the system next, you’ll be running the Linux kernel you had just installed.

Rollback the changes/Downgrade Linux Kernel with Ukuu

Rollbacking done in two steps:

  • Boot into an older kernel
  • Remove the newer Linux kernel you don’t want

Let’s see how to do that.

When you are booting into your system, on the grub menu, select the Advanced options for Ubuntu.

Select your old kernel to boot into it.

Once you boot into the system with the older Linux kernel, start Ukuu again. Make sure that you are not deleting the kernel that you are running at present.

Select the newer kernel version which you don’t want anymore and click on Remove.

That’s all you need to do here to downgrade the Linux kernel in Ubuntu.

While we are discussing it, I would like to point out a few more features of Ukuu. Ukuu has settings option that allows you to not display release candidates of kernels in the list. You can also hide Linux kernel versions older than version 4.0.

You can also choose the option to display desktop notifications in case new Linux Kernel are available.

You can also remove Ukuu using apt remove ukuu command.

How do you upgrade Linux kernel?

I hope this tutorial was helpful to show you how to install mainline Linux kernel in Ubuntu.

So, do you often upgrade Linux kernel on your own or do you wait for your distribution to provide the upgrade? How do you do it?

Like what you read? Please share it with others.

Источник

Читайте также:  Qss для windows 10
Оцените статью