Currently I'm running Linux-3.0 and I want to update it to Linux-3.3.1 the latest stable kernel release as mentioned at . Can I update to 3.3.1 in Ubuntu without any risk of crashes? I'm updating my kernel regularly as provided by the Update Manager..Currently I have Linux-3.0.0.17..Can I update?
NOTE:
The latest kernel version any user is supposed to use in Ubuntu is updated automatically via the Update Manager, so no action is normally required by user regarding kernel upgrades. What the question author is referring to is mainline kernel, see: Should I upgrade to the "mainline" kernels?
118 Answers
The simplest set of instructions I always used for kernel upgrade / downgrade are by ubuntuforums.org user by the name of lykwydchykyn (url modified by me for this post):
- Go here:
Download 3 (maybe 4) debs to a folder somewhere:
linux-headers-VERSION-NUMBER_all.deb linux-headers-VERSION-NUMBER_amd64.deb linux-image-VERSION-NUMBER_amd64.deb linux-image-extra-VERSION-NUMBER_amd64.deb # if availableInstall the debs with whatever package manager front-end you use (is gdebi still around?), or use these commands:
cd /path/to/folder/where/you/put/the/debs sudo dpkg -i *.deb
Sources:
12You could always do the following:
apt-cache search linux-imagePick the one you want and then do:
sudo apt-get install linux-image-your_version_choice linux-headers-your_version_choice linux-modules-extra-your_version_choice 8 My answer is, YES you can. The stable release was 3.4, but in this tutorial i use 3.3.1.
Ubuntu (32-bit) Generic PAE:
Run the following commands:
mkdir kernel\ v3.3.1-precise && cd kernel\ v3.3.1-precise
wget
wget
wget
sudo dpkg -i linux-*.deb
sudo update-grub
sudo reboot nowUbuntu (64-bit):
Run the following commands:
mkdir kernel\ v3.3.1-precise && cd kernel\ v3.3.1-precise
wget
wget
wget
sudo dpkg -i linux-*.deb
sudo update-grub
sudo reboot nowEnjoy!
2Contrary to some answers here Ubuntu releases the new kernel within a day or two of the main kernel team. I used to upgrade the hard way like some of the answers here suggest but I found this is an easier way.
Implications of manually installing Kernels
Manually installing kernels requires extra work.
There are reasons why you want to install the latest mainline kernel:
- A bug in the last Ubuntu LTS kernel update and you can't downgrade
- You have new hardware not supported in the current Ubuntu LTS kernel update stream or HWE updates
- You want a security upgrade or new feature only available in the latest mainline kernel version.
As of January 15, 2018 the latest stable mainline kernel is 4.14.13. At the time of writing many are interested to install it for protection against Meltdown security hole. If you choose to manually install it you should know:
- Older LTS kernels will not get updated until they are greater than the main menu first option titled Ubuntu.
- Manually installed kernels are not removed with the usual
sudo apt auto-removecommand. You need to follow this: How do I remove old kernel versions to clean up the boot menu? - Monitor developments in the older kernels for when you want to get back on the regular LTS kernel update method. Then delete the manually installed mainline kernel as described in the previous bullet point link.
- After manually removing the newest mainline kernel run
sudo update-gruband then Ubuntu's latest LTS kernel will be the first option called Ubuntu on Grub's main menu.
Finding the latest kernel
Go to (kernel.ubuntu.com - Kernel PPA Mainline) and press the End key:
Now click on the link 4.9.8 (or a newer one if available when you read this) and the following appears:
Note the links with the black airbrush marks. These are the three we will download for Ubuntu 16.04 64-Bit using Intel or AMD processors.
Installing using Terminal
Open a terminal session with Ctrl+Alt+T and use:
cd ~/Downloads # Change to your downloads directory
ll linux*.deb # Check if any previous downloads still exist
rm linux*.deb # Use this command if any previous downloads foundNow switch back to the download screen above and single-click on all three of the .deb kernel downloads. After downloads complete (you'll see status in your browser) switch back to terminal session and use:
sudo dpkg -i linux*.deb
rm linux*.deb
sudo rebootVoila! - you are running the latest kernel when the first option in grub boot menu is selected. Your older kernel versions are still available under grub's Advanced Options menu.
After installing the newest kernel a dozen times you will ask the question "How do I remove older kernel versions?" and you will find those answers here in Ask Ubuntu.
4Late but new answer.
I will add some more information in my answer. Now my old kernel was linux-headers-4.8.0-53. To find out which kernel you have type uname -r in terminal. Now type this command to get list of available kernels.
apt-cache search linux-imageThis will give you a very big output. Now chose one of them that you want to install and install it by following commands(Don't type these commands like this, replace the words kernal_version with the kernel version which you wish to install)
sudo apt-get install linux-image-kernal_version
sudo apt-get install linux-image-extra-kernal_version
sudo apt-get install linux-headers-kernal_versionNow in my case I choose linux-image-4.10.0-22-generic so my command will look like this
sudo apt-get install linux-image-4.10.0-22-generic
sudo apt-get install linux-image-extra-4.10.0-22-generic
sudo apt-get install linux-headers-4.10.0-22-genericNow in the end remove old kernel by command
sudo apt-get autoremoveNow when I first did it, I Don't know is it my hardware problem or because of removing the old kernel, but my laptop shows me black screen which happens to my laptop sometimes. Thus I remove it's battery and rebooted and typed the command. Also I don't suffer from my black screen issue any more.
uname -rand it gives me
linux-image-4.10.0-22-genericwhich means kernel is updated.
2There is a much simpler way of doing this, and it's the way I use. Simply download the Ubuntu Mainline Kernel Updater script and run it from a terminal. It will download the .deb's for you, install the new kernel, and optionally remove the old one (not recommended) then optionally reboot.
Example output (copied from my terminal):
evilsupahfly@the-black-beast:~$ sudo KernelUpdateChecker -no-rc -r utopic
Run this command to install the new kernel
/tmp/kernel-update
root@the-black-beast:~# /tmp/kernel-update
Config Notes:
Rejecting Release Candidates
Accepting Latest Kernel
Accepting kernels compiled for utopic
Accepting kernels with a version higher than 3.15.0-031500-lowlatency
Information:
Origin:
Kernel Version: 3.15.1-031501
Release Date: 2014/06/16 @ 18:41 (YYYY/MM/DD @ HH:MM)
Care to look at the change log? (y=Yes, n=No) (n)
(download output skipped)
Greetings root I (the-black-beast) am now self aware and a sentient being, have a nice day. Oh and by the way SKYNET is now active.
Installing Linux 3.15.1-031501:
(installer output skipped)
The New Kernel looks to have been installed
WARNING: If the new kernel does not boot you may regret saying yes here.
Would you like to remove the current one? (y=Yes, n=No) (n): n
Are you ready to Reboot? (y=Yes, n=No) (n): nAlmost entirely automated, and completely problem free.
1I wrote a script and always will be up to date.
ukupgrade: Ubuntu Kernel Upgrade
- Open your favorite terminal and run the follwing commands
Give executable permission to file
chmod +x ./ukupgradeCall the script
./ukupgrade
If you don't want to go through the hassle to manually upgrade the kernel you can try UUKU. Works fine even on Ubuntu derivatives like elementory, mint.
I used it to fix my WiFi issue as sometimes some new hardware won't be detected by old kernel. Other than hardware driver update I don't find the need to upgrade kernel. New kernels do have security and slight performance upgrade but also have tendency to break things like your VM.
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install ukuu
ukuu-gtkSOURCE:
Run the following Terminal commands to install a new Ubuntu mainline kernel.
sudo apt-get update
sudo apt-get install python-bs4 python-apt
cd /tmp
rm -rf medigeek-kmp*
wget -O kmpd.tar.gz
tar xzf kmpd.tar.gz
cd medigeek-*
python kmpd.py -dThe script is hosted at Github. Just press Enter instead of a number if you get stuck on a certain question in the Python script.
6Another option is to try customized and optimized builds, such as this i3/i5/i7 optimized 3.2.1 kernel for Ubuntu:
DuoPetalFlower, My Experiments with Linux - 3.2.1 kernel
He also has Intel atom optimized builds which can work quite well if you're trying to squeeze every last ounce of performance out of a netbook.
There are other kernels like Liquorix that claim to be better optimized for desktop performance.
Though not recommended by some, you can often run official kernels from later versions of Ubuntu without issues. I'm currently running the 3.3.3 precise kernel on oneiric and my machine works better than ever. Performance & battery life increased, while temperatures dropped a few degrees. My issue of a black screen when resuming from standby has also disappeared. Though I personally haven't had issues from using newer kernels, you will find some people who are strongly opposed to doing this.
As you've seen, Ubuntu does provide versions of the Linux kernel, but not always as fast as they are released upstream, you can always compile the 3.3.1 kernel yourself, but that may be more effort than you were looking for. If not, search around and I'm sure you'll find a tutorial you can follow such as this one. (note that I haven't checked that one thoroughly so be wary as kernels are dangerous beasts)
I created this script kernel-upgrade.sh that downloads and installs a selected kernel from :
TMP=/var/tmp/kernel
mkdir -p "$TMP" && cd "$TMP"
rm -f "$TMP"/*
F=v4.16-rc6
V=4.16.0-041600rc6
R=$(wget -qO - "" | sed -ne '/^+linux/{s/.*\.\([0-9]\+\)).*/\1/p;q}')
B="$V.$R"
URL=
set -x
wget "$URL/$F/linux-headers-$V-generic_${B}_amd64.deb" \ "$URL/$F/linux-headers-${V}_${B}_all.deb" \ "$URL/$F/linux-image-$V-generic_${B}_amd64.deb"
sudo dpkg -i "linux-headers-$V-generic_${B}_amd64.deb" \ "linux-headers-${V}_${B}_all.deb linux-image-$V-generic_${B}_amd64.deb"
# now enter: sudo reboot nowIn case Ubuntu doesn't start with the new kernel, you can select "advanced settings" in your grub menu and select to start the last running kernel there.
Note: since 4.15-rc7 the kernel has the KPTI fix against meltdown attacks and since 4.15.1 for "Spectre Variant 2, Mitigation 2" (check with )
8to install the latest kernel install Ubuntu Kernel Update Utility
$ sudo add-apt-repository ppa:teejee2008/ppa
$ sudo apt-get install ukuudisable access control with the following command:
$ sudo xhost +then install with ukuu
$ sudo ukuu
$ sudo ukuu --install-latestthen run for secure
$ sudo xhost -and reboot
$ sudo reboot 4 None of the above answers satisfied my problem of manually update the kernel to the latest stable version. (My current laptop is very sensitive to RCs, Dell XPS 9365).
I created a shell script that searches for more recent kernel versions and shows them as options to be installed. You can give it a try, it's on github, please be sure to read the README.
2Actually I found a really easy commandline interface for upgrading which is hassle free, its a single bash script called ubuntu-mainline-kernelInstall:
apt install wget
wget
chmod +x ubuntu-mainline-kernel.sh
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/then for help
ubuntu-mainline-kernel.sh -hor just checkout the README.md on the first link. Easy and doesn't install extra junk
Check Your Kernel Version$ uname -sr
Download Kernel v5 for 32 bit
$ wget
$ wget
$ wget
$ wget
Download Kernel v5 for 64 bit
$ wget
$ wget
$ wget
$ wget
Install it
$ sudo dpkg -i *.deb
Then Reboot
sudo reboot
I had some problems with some Kernels (performance, battery life) so after getting tired of install and uninstall kernels manually I developed this script:
Also, a short explanation of the script here
0There is a fork of UKUU, it is named Mainline, it is located at Github.
And installable from PPA as follows:
sudo add-apt-repository ppa:cappelikan/ppa
sudo apt-get update
sudo apt-get install mainlineAnd then it will be available as mainline (CLI) and mainline-gtk (GUI).