Can I install Linux kernel in Ubuntu appart of the default one?

Solution 1:

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".

Solution 2:

You can try a simple python script: https://github.com/medigeek/kmp-downloader

Requires python-bs4:

sudo apt-get install python-bs4

You can download it using this quick link: https://github.com/medigeek/kmp-downloader/tarball/master

Save the archive and extract the files. Double click on kmpd.py. If you're not sure about an option, press Enter and it will select the default one.

Solution 3:

Unless you really need to actually install the new kernel for a reason then i would just leave it. But then who am i to advise you otherwise! I have been there and tried to just to see what its like and its taken me a few different attempts before i have had any successful results. Given it wont break your install as you can always jump back to the last kernel in grub.

Ubuntu has great documentation. I suggest using this is you go for it.

Reasons for compiling a custom kernel

  • You are a kernel developer.
  • You need the kernel compiled in a special way, that the official kernel is not compiled in (for example, with some experimental feature enabled).
  • You are attempting to debug a problem in the stock Ubuntu kernel for which you have filed or will file a bug report.
  • You have hardware the stock Ubuntu kernel does not support.
  • You love computers and are curious and interested in hacking on your own GNU/Linux system to learn more about how it works (with the understanding that you'll need to fix anything you break).

This is taken from said docs aswell.

Referring to thomas post above that is true. Im sure ubuntu do actually have their own tweaked version.

Good luck!