How to Install/Upgrade to Kernel 4.0 in Ubuntu, Linux Mint

Last updated: July 28, 2015

Linux Kernel 4.0

Linux Kernel 4.0, a new stable release, has been announced by Linus Torvalds last night. He wrote on the Linux kernel mailing list:

So I decided to release 4.0 as per the normal schedule, because there really weren’t any known issues, and while I’ll be traveling during the end of the upcoming week due to a college visit, I’m hoping that won’t affect the merge window very much. We’ll see.

Linux 4.0 was a pretty small release both in linux-next and in final size, although obviously “small” is all relative. It’s still over 10k non-merge commits. But we’ve definitely had bigger releases (and judging by linux-next v4.1 is going to be one of the bigger ones).

What’s New in Kernel 4.0:

Linux Kernel 4.0, formerly known as Linux 3.20, features:

  • Live Kernel Patching, ability to install security kernel updates WITHOUT REBOOT.
  • DisplayPort Audio, and better better fan control support for the Radeon DRM driver.
  • Graphics and power-management support for Intel’s Skylake processors
  • Intel Quark SoC support
  • PlayStation PS 3 support.
  • new ARM hardware support, IBM z13 support, better Toshiba laptop support, improved Logitech HID support, and more.

Install Kernel 4.0 in Ubuntu/Linux Mint:

The Ubuntu Kernel Team has made the binary packages for this kernel release, available for download at link below:

Download Kernel 4.0 (.DEB)

First check out your OS type, 32-bit (i386) or 64-bit (amd64), then download and install the packages below in turn:

  1. linux-headers-4.0.0-xxx_all.deb
  2. linux-headers-4.0.0-xxx-generic_xxx_i386/amd64.deb
  3. linux-image-4.0.0-xxx-generic_xxx_i386/amd64.deb

After installing the kernel, you may run sudo update-grub command in terminal (Ctrl+Alt+T) to refresh grub boot-loader.

If you need a low latency system (e.g. for recording audio) then download & install below packages instead:

  1. linux-headers-4.0.0_xxx_all.deb
  2. linux-headers-4.0.0-xxx-lowlatency_xxx_i386/amd64.deb
  3. linux-image-4.0.0-xxx-lowlatency_xxx_i386/amd64.deb

For Ubuntu Server with a graphical UI, you may run below commands one by one to grab packages with wget and install them via apt-get:

For 64-bit system run:

cd /tmp/

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000_4.0.0-040000.201504121935_all.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-image-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb

sudo dpkg -i linux-headers-4.0.0-*.deb linux-image-4.0.0-*.deb

For 32-bit system, run:

cd /tmp/

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000_4.0.0-040000.201504121935_all.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-image-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb

sudo dpkg -i linux-headers-4.0.0-*.deb linux-image-4.0.0-*.deb

Uninstall Linux Kernel 4.0:

If for some reason, the new kernel does not work properly for you, reboot into a previous Kernel (Grub boot loader -> Advanced -> select a previous kernel) and run below command in terminal to remove the Linux Kernel 4.0:

sudo apt-get remove linux-headers-4.0.0-* linux-image-4.0.0-*

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

16 responses to How to Install/Upgrade to Kernel 4.0 in Ubuntu, Linux Mint

  1. Terrible How-To. You went directly from downloading the headers and kernel to “After installing the kernel, you may run sudo update-grub command in terminal”. How about the part where you actually install the headers and kernel? Oh that might be to easy in a post about installing a Linux Kernel.

    • donkeyofdarkness April 16, 2015 at 6:30 pm

      sudo dpkg -i linux-headers-4.0.0-*.deb linux-image-4.0.0-*.deb

      The author included it just after the wget parts

  2. Install any Ubuntu Linux kernel from:
    http://kernel.ubuntu.com/~kernel-ppa/mainline/

    I save the needed kernels in my archive folder. In my case, this archive folder is off-line, on a NTFS-compressed partition (Win8.1 format). All my Linux & Windows operating systems have no trouble read-write-install from this off-line drive.

    Double click on the Linux kernel icon. It will auto-install. Do the ALL, then IMAGE & HEADERS, in that order.

    Or move your cursor to the folder where the three files (ALL, IMAGE, HEADER) are kept. Open a terminal in that folder. Then run the command:

    sudo dpkg -i linux-*.deb

    This will work for any Linux kernel, into any Ubuntu-based distro. According to Distrowatch.com, there are 69 such distros. Of course, the real number is much, much higher than that.

    The above method will also work for all beta & alpha Linux kernels. Grub-customizer will allow a GUI-based way to skillfully put the multi-boot menu in the order you prefer. On my website & my Youtube channel, I’ll show you all, one day, how easy & “simple” this GUI method is.

    Retired Chief Information Officer (1984)
    Australian Capital Territory.

  3. i am a newbie, and i dont get it:

    sudo dpkg -i linux-headers-4.0.0-*.deb linux-image-4.0.0-*.deb

    we have downloaded two package but installed linux-headers-4.0.0…. linux-image-4.0……

    will we install only 2 packages? where is the linux-headers-4.0.0_xxx_all.deb ?

    or we must install all the packages including all.deb? in turn…?

    thanks

    • the “linux-headers-4.0.0-*.deb” will automatically select and install both the “linux-headers-4.0.0_xxx_all.deb” and “linux-headers-4.0.0_xxx-generic-xxx_i386/amd64.deb” since both packages’ name started with linux-headers-4.0.0-

      • i got some errors, are those important?:

        Error! Bad return status for module build on kernel: 4.0.0-040000-generic (i686)
        Consult /var/lib/dkms/virtualbox-guest/4.3.18/build/make.log for more information.

        Error! Bad return status for module build on kernel: 4.0.0-040000-generic (i686)
        Consult /var/lib/dkms/virtualbox-guest/4.3.18/build/make.log for more information.

        W: Possible missing firmware /lib/firmware/rtl_nic/rtl8107e-2.fw for module r8169
        W: Possible missing firmware /lib/firmware/rtl_nic/rtl8107e-1.fw for module r8169
        W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168h-2.fw for module r8169
        W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168h-1.fw for module r8169

        but os doesnt seem to be effected badly, it boots and everything works properly….

        • Hal , you have to recompile , virtual box kernel modules , to fix the error.
          And than you have to download rtl8168h-2.fw which is Wifi or Audio driver.
          And your good to go

  4. thanks mate – just ran it all and it works as a charm. nice from you to have the write-up available here.

  5. Alvin-Michael Tiago Linton May 13, 2015 at 9:44 pm

    Great tutorial very straight forward, never-mind the negative Nancy that`s to stupid to follow instructions.

  6. Hi,

    I installed the kernel however I get a kernel panic and can’t start so I’m logged back in under the old kernel however I can’t remove the new one. I get the following error message:

    E: Unable to locate package linux-headers-4.0.0-*
    E: Couldn’t find any package by regex ‘linux-headers-4.0.0-*’
    E: Unable to locate package linux-image-4.0.0-*
    E: Couldn’t find any package by regex ‘linux-image-4.0.0-*’

    Here’s the output of ls -l on /boot:
    -rw-r–r– 1 root root 1268815 Apr 30 18:23 abi-3.19.0-16-generic
    -rw-r–r– 1 root root 1258025 May 8 16:43 abi-4.0.2-040002-generic
    -rw-r–r– 1 root root 177656 Apr 30 18:23 config-3.19.0-16-generic
    -rw-r–r– 1 root root 183518 May 8 16:43 config-4.0.2-040002-generic
    drwxr-xr-x 5 root root 4096 May 16 14:07 grub
    -rw-r–r– 1 root root 20827390 May 15 08:05 initrd.img-3.19.0-16-generic
    -rw-r–r– 1 root root 19818521 May 16 13:56 initrd.img-4.0.2-040002-generic
    -rw-r–r– 1 root root 164216 Mar 6 16:23 memtest86+.bin
    -rw-r–r– 1 root root 165892 Mar 6 16:23 memtest86+.elf
    -rw-r–r– 1 root root 166396 Mar 6 16:23 memtest86+_multiboot.bin
    -rw——- 1 root root 3615358 Apr 30 18:23 System.map-3.19.0-16-generic
    -rw——- 1 root root 3008732 May 8 16:43 System.map-4.0.2-040002-generic
    -rw——- 1 root root 6611904 Apr 30 18:23 vmlinuz-3.19.0-16-generic
    -rw——- 1 root root 6325520 May 8 16:43 vmlinuz-4.0.2-040002-generic

    So it looks like it’s installed but apt doesn’t seem to think so. How do I get rid of it?

    Thanks

    • Seems you’ve installed kernel 4.0.2, so the command should be:

      sudo apt-get remove linux-headers-4.0.2-* linux-image-4.0.2-*

      refresh grub boot-loader if previous command doesn’t do it:

      sudo update-grub
      • Didn’t realise I’d done that :D

        I was able to remove the headers however it says it’s couldn’t find the image file to remove. I updated grub however it’s still showing in the grub list. I guess I could edit it out of grub however at the next update grub will put it in again so hoping for something a little more permanent. Have you any other ideas?

  7. cornelis stravers May 28, 2015 at 7:16 pm

    would not compile due to wl mod needed for my wireless card.

  8. When i run
    cpupower frequency-info

    it follows by this:
    You may need to install the following packages for this specific kernel:
    linux-tools-4.0.0-040000-generic
    linux-cloud-tools-4.0.0-040000-generic

    Is there any chance to have it soon?
    Thank’s!!

  9. Guys, I am confused don’t you need to compile the kernel after the install?
    I mean like with the command:

    sudo make && make modules && make install && make modules_install

    Regards,
    Kanka76

  10. I get the following errors when I try an installation of the headers DEB file:
    ————————————————————————-
    userXXXX@hostXXXX ~/Downloads $ sudo dpkg -i linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb
    [sudo] password for userXXXX:
    Selecting previously unselected package linux-headers-4.0.0-040000-generic.
    (Reading database … 243332 files and directories currently installed.)
    Preparing to unpack linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb …
    Unpacking linux-headers-4.0.0-040000-generic (4.0.0-040000.201504121935) …
    dpkg: dependency problems prevent configuration of linux-headers-4.0.0-040000-generic:
    linux-headers-4.0.0-040000-generic depends on linux-headers-4.0.0-040000; however:
    Package linux-headers-4.0.0-040000 is not installed.

    dpkg: error processing package linux-headers-4.0.0-040000-generic (–install):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    linux-headers-4.0.0-040000-generic
    ———————————————————————-
    Please advise. TIA.