I was told on Launchpad to test a mainline Kernel. How do I do that (with NVIDIA drivers)?

Solution 1:

Mainline kernels are compiled from recent sources using the Ubuntu configuration, so any bugfixes will first appear in the mainline kernel. Since the kernel package receives a lot of bug reports, the developer team cannot spend a lot time on all bug reports. Your reported bug may be fixed before, so that's why they tell you to test it with the most recent kernel.

To install a mainline kernel:

  1. Find the latest kernel on http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=M;O=D. At the moment, it's http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.1-rc9-oneiric/
  2. Create a new directory for saving the downloaded kernel packages (e.g. ~/kernel-test)
  3. Download the linux-headers*_amd64.deb, linux-headers*_all.deb and linux-image*_amd64.deb files. Replace amd64 by i386 if you're running a 32-bit OS, and pick the "pae" version if you want it. You can check if you're running pae now by looking in /proc/cpuinfo.
  4. Open a terminal and install the downloaded kernel packages:

    sudo dpkg -i ~/kernel-test/*.deb
    
  5. Reboot and the new kernel will automatically be selected. If it won't boot, either try pressing Ctrl + Alt + Del or using the power button. The next boot, the menu will appear. If not, hold Shift after the BIOS POST.

To uninstall the mainline kernel, simply uninstall the related packages:

sudo apt-get purge linux-headers-3*-generic linux-image-3*-generic

Replace * by the package names of the mainline kernels. It matches the file you've downloaded.

Be aware that the mainline builds are compiled with an older toolset which has some side-effects like being unable to unload kernel modules after loading them (this applies to DKMS packages like nvidia-current)