Ubuntu – Should I upgrade to the “mainline” kernels


Newer "mainline" versions of the kernel are available from the Ubuntu kernel team, e.g. 3.4 and 3.5, while Ubuntu 12.04 is on 3.2.

  • What are the mainline kernels?
  • Are they better than my existing kernel?
  • What are the pros and cons of upgrading to a mainline kernel?
  • Will I easily be able to go back?

Best Answer

Upgrading to a mainline kernel is usually not a good idea

Most of the basic information in this answer is from the Mainline Builds wiki

1. They are provided only for testing and are unsupported

  • The mainline kernels are built from the latest unmodified "mainline" Linux kernel sources.
  • The Ubuntu kernel team provides these only for testing and debugging purposes, to see whether issues have been fixed "upstream", i.e. by the Linux kernel developers.
  • They are therefore not supported and must be used at your own risk; you can report possible bugs to kernel.org via kernel-oops, or if you want a faster solution, try posting to the Linux Kernel Mailing List

2. They will often break drivers, especially Nvidia/AMD and wireless (Broadcom)

  • The mainline kernels do not include any Ubuntu-provided drivers or patches
  • This means no binary drivers for graphics, wireless, etc. are provided
  • If you try installing binary drivers downloaded directly from the manufacturers, there is a very good chance they will not work because the mainline headers may be incompatible.
    • This will be especially true for non-LTS versions after 12.04 (12.10, 13.04, ...), because the mainline kernels are built using the last LTS toolchain (compilers, etc.), which is generally older than the toolchain on the latest non-LTS release.

3. You should only install these if you believe they may fix a critical problem you are having with the current kernel

  • Newer kernels sometimes contain fixes for a hardware or filesystem problem you may have. For example, the internal HD4000 graphics on the latest Intel Ivy Bridge CPUs occasionally froze, a bug which was fixed in kernels 3.3.6 and newer.
  • You can try installing a mainline kernel in these circumstances, and see if it helps your problem.
  • If it does, you should consider upgrading to the latest Ubuntu+1 kernel instead, which does have binary drivers available for it.

4. If you install a mainline or other newer kernel, you can still choose to use your old (stable) kernel by selecting it at boot-time:

  • Keep Shift pressed after turning on your computer.

  • You will see the Grub menu as shown below. User the down arrow to go to "Previous Linux Versions" and press Enter

    enter image description here

  • Select the option which has a version of x.x.x-generic, NOT one that has x.x.x-yyyyyy-generic and press Enter. This is usually the first option unless you have installed multiple mainline/custom kernels.

    enter image description here