26

So I'm rebuilding my storage server. For stability, I want to use Ubuntu server 14.04 LTS as the OS. However, I'm planning to use Btrfs with RAID 5, and this has been greatly improved in kernel 3.19. So I want to use that kernel with 14.04.

I know that 3.19 is the kernel that will be used in 15.04, and is scheduled to be released in August as a HWE kernel and the default for 14.04.3. But I need to build this server now.

I don't want to get into funky custom set-ups that will break things in future. So what is the most trouble free way I can use that kernel now on top of a 14.04.2 installation, that can be easily reverted to standard in August, when I can dist-upgrade to 14.04.3 and get the kernel I want as standard?

4
  • 1
    One way to do it is get the 3.19 packages from this PPA, and install them manually with dpkg -i. I don't know if this is the most (or the second/third most) trouble free way, but it is something to try. Mar 19, 2015 at 0:13
  • 1
    I'm actually facing this exact same issue myself at the moment. The question I had is: is upgrading to kernel 3.19 enough to get the better support, or is it also necessary to upgrade btrfs-tools?
    – Tobias J
    Mar 20, 2015 at 2:20
  • @TobyJ That's a good point about btrfs-utils, I think the answer is yes, I'll have to look into upgrading that package too.
    – Degenerate
    Mar 23, 2015 at 2:15
  • Yes, you can. Follow official instructions at wiki.ubuntu.com/Kernel/LTSEnablementStack
    – Bellera
    Sep 5, 2015 at 14:42

4 Answers 4

43

You can install a newer kernel

  • as described in Kernel/MainlineBuilds or

  • in this case more simply with the packages built from linux-lts-vivid from the trusty-updates repository:

    sudo apt-get install linux-generic-lts-vivid
    

    This meta-package always depends on the most recent version of Canonical's v3.19 kernel branch.

    The equivalent for the v4.4 kernel branch of Ubuntu Xenial is linux-generic-lts-xenial (what a surprise).

Since kernel packages of different branches don't replace each other, there is virtually no danger, that either of the above steps will make your system unbootable¹. If the newly installed kernel doesn't run, you can select to boot different/previous kernels in the GRUB menu during boot.

¹ The most notable exception is a broken GRUB configuration. If update-grub (called by the kernel package post-installation and post-removal scripts) doesn't work without the new kernel, it won't work with the new kernel either.

7
  • Thanks David, I'll go with this, then use ppa-purge to clean up in August before I dist-upgrade.
    – Degenerate
    Mar 23, 2015 at 2:20
  • I would like to update kernel as well. However, can you write commands (or instructions) how to restore to old one in case my update fail? Currently I am using Ubuntu 14.04.2 with linux kernel 3.16. May 17, 2015 at 15:27
  • Kernel updates don't replace previous kernels. You can select to boot different/previous kernels in the GRUB menu during boot. May 17, 2015 at 17:40
  • 3
    Now there is no need to use this ppa. 3.19 kernel is in trusty-updates repository. It can be installed by sudo apt-get install linux-generic-lts-vivid.
    – Pilot6
    May 26, 2015 at 9:17
  • Is this still the latest? What about wily?
    – smac89
    Jan 21, 2016 at 22:03
12

You can now install the "latest" (3.19) Ubuntu kernel directly from the repositories:

sudo apt-get install linux-image-generic-lts-vivid linux-headers-generic-lts-vivid

This will install stable Ubuntu kernel for Vivid. And the headers that are needed for building several modules on your system.

Hope this helps!

8

The easiest way to upgrade kernel to 3.19 in Ubuntu 14.04 is to run:

sudo apt-get install linux-generic-lts-vivid

This will install meta package, that will pull everything else. Image and headers will be installed.

This method is good, because 3.19 kernel will get security updates and bug fixes through routine update & upgrade process.

Old kernels 3.13 or 3.16 will not be removed. They will be bootable using grub menu. And they will get updates too.

If you do not want 3.13 or 3.16 kernel to be updated, you can remove meta packages:

linux-image-generic linux-headers-generic for 3.13

linux-image-generic-lts-utopic linux-headers-generic-lts-utopic for 3.16

4
  1. Go to http://kernel.ubuntu.com/~kernel-ppa/mainline/
  2. Enter the most recent v3.19 directory (today it is v3.19.2-vivid)
  3. Download 3 files:

    linux-headers-3.19.X-ZZZZZZ_3.19.X-ZZZZZZ.YYYYMMDDHHMM_all.deb
    linux-headers-3.19.X-ZZZZZZ-generic_3.19.X-ZZZZZZ.YYYYMMDDHHMM_ARCH.deb
    linux-image-3.19.X-ZZZZZZ-generic_3.19.X-ZZZZZZ.YYYYMMDDHHMM_ARCH.deb
    

    Be careful, one of the linux-headers is common to all architectures (_all.deb). The other linux-headers and the linux-image must match your machine's architecture (_i386.deb or _amd64.deb).

  4. From the terminal, install all of them by running:

    sudo dpkg -i linux-{image,headers}-3.19.*.deb
    

    Or just use the TAB auto-completion to help you typing the full file names.

6
  • 2
    It is not recommended to install mainline kernels with no specific reason. Especially when Ubuntu kernel is available.
    – Pilot6
    May 26, 2015 at 9:18
  • 2
    @Pilot6 I guess when someone ventures into installing kernels, they know they have a specific reason. Dec 7, 2015 at 22:26
  • Also, linux-generic-lts-vivid wasn't available at the time of this answer. Dec 7, 2015 at 22:32
  • @EricCarvalho To my knowledge, linux-headers is only necessary if you want to compile your own kernel. If you just want to use the kernel, linux-image will be perfectly sufficient. Jan 24, 2016 at 2:24
  • @Pilot6 In my case, I actually had to. On my old machine, nothing before 4.4.0 made my PATA controller initialize and the drive(s) boot (LP bug 1536397). And at the time of writing, 4.3.4 is latest available in Xenial. However, I can now prove that any kernel from 4.2.0 to last before 4.4.0 is unusable. Sometimes the Ubuntu folks really take WAY TOO long to release a kernel to the public. 4.4.0 is really excellent; but I don't expect it to be included in 16.04 final in April. So bug reports will accumulate in no time, instead of them ditching 4.2 and 4.3 once and for all. Jan 24, 2016 at 2:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .