39

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

5
  • Stay away from kernel 3.4.0-030400_3.4.0-030400.201205210521 it has a seriuos NFS bug! I know I tested it on 12.04.
    – user76366
    Jul 11, 2012 at 13:29
  • 1
    @EliahKagan: That's wrong. LTS-versions do get newer kernels because it needs to support newer hardware. As you point out, they don't replace the older version, but they become available as an option in the repos. Jul 19, 2012 at 0:59
  • 1
    Now you can install Linux 3.4, which is Quantal's kernel, pretty easy in Precise: linux-generic-lts-quantal
    – Andre
    Dec 2, 2012 at 17:41
  • Andre, why don't you state this as an answer? It's the easiest way IMHO. Jan 8, 2013 at 2:29
  • Yes! You can ! !
    – BigSack
    Dec 4, 2013 at 15:44

3 Answers 3

39

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

3
  • 1
    Of course, though, if you have no idea what you're doing with the kernel, best to not mess with it, MountainX. My post was targetted for the Ubuntu team's recommendations as to why not to upgrade, but if you know what you're doing there's no problem, because you'll know how to fix your system ;P
    – Thomas Ward
    May 25, 2012 at 21:13
  • Please do not use URL shorteners, especiallly if the real URL is just twice as large as the shortened URL!
    – Lekensteyn
    May 26, 2012 at 9:13
  • 1
    Am I missing something, or would the second option not also mean that the next software update would bring down a bunch of stuff for the current 12.10 alpha, that may not be suitable for primetime?
    – Jon Hanna
    Jul 29, 2012 at 22:27
3

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.

4
  • 1
    Your quick link is pointing to another project that has nothing to do with kernels, please fix it asap. Aug 19, 2012 at 20:24
  • 1
    One important step is missing: sudo update-grub (it's not obvious for new users; many tutorials skip this). Apr 24, 2018 at 10:26
  • @VasilyRyabov that used to be covered by the deb package. I haven't tested the script in a while now, are you sure grub is not updated when you install kernel deb packages using kmp downloader? Apr 27, 2018 at 4:48
  • 1
    Yes, I'm absolutely sure. Just tested it a few days ago on Ubuntu 16.04. Updated to kernel 4.14.33 generic. Apr 27, 2018 at 20:33
1

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!

4
  • another reason is: I have too much spare time that I want to spend with my Linux.
    – Alvar
    May 26, 2012 at 8:43
  • Haha i know thats exactly why i did it!
    – LinuxBill
    May 26, 2012 at 18:27
  • Another reason - the stock 12.04 kernel (v3.2) has a bug that you consistently run into that is fixed in 3.4.
    – Shauna
    Jul 16, 2012 at 16:16
  • 1
    In my case, there are two main reasons; wlan is very slow in 12.04 and very fast in Quantal. I suspect that's because of improvements in the kernel. Also, I really want to use BtrFS, which was extremely slow in 12.04, but seems much faster in Quantal. So I'm hoping my two main griefs with 12.04 will be solved by switching to Linux 3.4. Jul 19, 2012 at 1:04

You must log in to answer this question.

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