You can install the mainline kernel from the ppa
http://kernel.ubuntu.com/~kernel-ppa/mainline/
Or you can compile it yourself
https://help.ubuntu.com/community/Kernel/Compile
The problem you are going to have with those options is twofold
Neither the mainline kernel or compiling a newer kernel are going to have the standard set of patches Ubuntu applies, most notable is Apparmor.
Any packages that depend on the kernel, Virtualbox, nvidia, wireless, etc, might not work.
You would need to debug those things yourself or wait for the Kernel team to release an updated kernel. Support for the mainline kernel or custom kernel is limited, more so for third party packages such as virtualbox , nvidia drivers, etc.
I am not trying to either encourage or discourage you, just pointing you in the right direction. I have been using a custom kernel on gentoo for almost 2 years now, but doing so requires a moderate amount of effort on my part.
From the kernel team FAQ
The mainline kernels builds are produced for debugging purposes and therefore come with no support. Use them at your own risk.
Your other option is to build a custom kernel. This is also poorly supported and requires some advanced knowledge
See https://help.ubuntu.com/community/Kernel/Compile
Building and using a custom kernel will make it very difficult to get support for your system.
While it is a learning experience to compile your own kernel, you will not be allowed to file bugs on the custom-built kernel (if you do, they will be Rejected without further explanation).
Your best option may be to install 12.04. Be warned it is in beta at the moment, you might want to wait for the release.
- You may be better off filing a bug report
How do I report a bug?
12.04.2 includes Kernel 3.5 along with a newer Xorg, as part of the hardware enablement package, which is available here:
Do note that the Ubuntu image ISOs are also updated to use the new stack, so if you are doing new installations and want to keep the released 12.04 stack, you need to install from the older ISOs. These kernel upgrades are also not offered as part of normal upgrades, so there's no need to worry that you'll be upgraded from one major kernel version to the other. See the wiki page for more information.
The 3.2 kernel released with 12.04 will continue to be maintained for the life time (5 years) of precise. (and also Debian Wheezy)
This is a new policy. The decision to have such a updated kernel and Xorg was decided at the 2012 Ubuntu Developer Summit (UDS) in Oakland.
The most exciting feature about 3.5 (IMHO), Seccomp2, is part of the Precise 3.2 kernel.
Best Answer
This can break your system. The NVIDIA and ATI/AMD drivers and the broadcom wireless will most likely not work on this yet.
I would advise against it but if things get messed up you should be able to fix it by booting an old kernel and removing this one. Something like this ...
From comment by Tomas an easier method:
Download the three .DEB files with the name starting with
linux
from here: http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/Example for i386 (take the 2 with
amd64
in the name for 64-bit andpae
in the name for i386 with 4+Gb memory; checkuname -a
if you are unsure!):Example for i386
This should show a kernel with 3.4 in the name.