Ubuntu – install Linux kernel in Ubuntu appart of the default one


Can we install the latest kernel 3.4 in Kubuntu or Ubuntu 12.04 LTS? If not then please clarify the reason.

Best Answer

To install Linux Kernel 3.4 on Ubuntu (or Kubuntu, etc.) 12.04, you want to use a Ubuntu version of the kernel, not the generic Linux kernel. This avoids the generic kernel problems mentioned by Thomas Ward in his answer.

A stable version of Linux 3.4 has just been released and this version has important changes for btrfs, so many users of 12.04 LTS may be interested in this kernel.

For new changes and improvements in Kernel 3.4, you can refer to this page.

You can find the Ubuntu specific kernels at this page.

There are three ways you can potentially upgrade to Ubuntu-specific kernel 3.4:

  • First, you can download the Ubuntu 3.4 kernel deb packages and install them manually. See details below.

  • Second, you can change the apt sources list as explained here: http://www.upubuntu.com/2012/05/how-to-install-kernel-340-stable-on.html. I haven't tested this approach and I'm not recommending it.

  • Third, you can wait on an official backport of this kernel in a PPA or in -backports for 12.04 LTS. I don't have any further info on this option.

Here are more details on how to do the first option:

To use a new kernel as-is you only need to download and install the image.deb package that corresponds to your architecture; however if you need to build any external modules you also need the correct header.deb and source.deb packages.

You can find the Ubuntu kernels here: http://kernel.ubuntu.com/~kernel-ppa/mainline/

Ubuntu apparently released kernel 3.4 for Precise on 21-May-2012 09:41. See this link: http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/

Make sure you download the correct matching files (32bit or 64bit or PAE).

Open a terminal and move to the directory where you have downloaded the Ubuntu 3.4 kernel packages. If the files are in /Downloads directory then run the following command.

$ cd ~/Downloads/

Then use dpkg command to install the packages, for example, here I assume the 32-bit versions of the packages. Run the following commands one by one and type the password for sudo access when prompted.

For linux-headers (of the 3 files, this one is not architecture specific):

$ sudo dpkg -i linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb

For linux-headers-generic (is architecture specific):

$ sudo dpkg -i linux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_i386.deb

For linux-image-generic (is architecture specific):

$ sudo dpkg -i linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_i386.deb

If you see any warnings or errors while installing then try installing module-init-tools (latest version) first, and try again now it should work. Restart your system now; by default it will boot kernel 3.4. To check the kernel version after booting, open a terminal and type "uname -a".