Want to install the latest Linux Kernel? A simple script can always do the job and make things easier in Ubuntu.
Michael Murphy has created a script makes installing the latest RC, stable, or lowlatency Kernel easier in Ubuntu. The script asks some questions and automatically downloads and installs the latest Kernel packages from Ubuntu kernel mainline page.
Install / Upgrade Linux Kernel via the Script:
1. Download the script from the right sidebar of the github page (click the “Download Zip” button).
2. Decompress the Zip archive by right-clicking on it in your user Downloads folder and select “Extract Here”.
3. Navigate to the result folder in terminal by right-clicking on that folder and select “Open in Terminal”:
It opens a terminal window and automatically navigates into the result folder. If you DON’T find the “Open in Terminal” option, search for and install nautilus-open-terminal
in Ubuntu Software Center and then log out and back in (or run nautilus -q
command in terminal instead to apply changes).
4. When you’re in terminal, give the script executable permission for once.
chmod +x *
FINALLY run the script every time you want to install / upgrade Linux Kernel in Ubuntu:
./*
I use * instead of the SCRIPT NAME in both commands since it’s the only file in that folder.
If the script runs successfully, restart your computer when done.
Revert back and Uninstall the new Kernel:
To revert back and remove the new kernel for any reason, restart your computer and select boot with the old kernel entry under Advanced Options menu when you’re at Grub boot-loader.
When it boots up, see below section.
How to Remove the old (or new) Kernels:
1. Install Synaptic Package Manager from Ubuntu Software Center.
2. Launch Synaptic Package Manager and do:
- click the Reload button in case you want to remove the new kernel.
- select Status -> Installed on the left pane to make search list clear.
- search linux-image- using Quick filter box.
- select a kernel image “linux-image-x.xx.xx-generic” and mark for (complete) removal
- finally apply changes
Repeat until you removed all unwanted kernels. DON’T carelessly remove the current running kernel, check it out via uname -r
(see below pic.) command.
For Ubuntu Server, you may run below commands one by one:
uname -r dpkg -l | grep linux-image- sudo apt-get autoremove KERNEL_IMAGE_NAME
Thank you for posting as a topic. However, for those who didn’t want to install synaptic or any other tool, is these any alternate way to remove unwanted kernel manually?
Use Ubuntu Software Center if know the exact package name you want to remove, or use the command way.
There’s also a script called purge-old-kernels. Search for and install
bikeshed
in Ubuntu Software Center, and get the usage viaman purge-old-kernels
command in terminalHmm…tried the script but it seems to always download the latest kernel (unstable in this case), how to download latest stable using it? is it even possible?
The script only provides options to download latest RC or “unstable” release. And since kernel 4.1, all binaries from the link marked as unstable~
http://kernel.ubuntu.com/~kernel-ppa/mainline/
Thanks, installed the 4.2, no problems so far.
There is a project called “ukupgrade” that is a script download latest stable or rc kernel based on your answer.
https://github.com/muhasturk/ukupgrade
Hi,
I’ve tried because i can’t compile driver and unrar some archives but at the end of the script i have ” Errors were encountered while processing:
linux-headers-4.4.0-040400-generic_4.4.0-040400.201601101930_i386.deb
linux-image-4.4.0-040400-generic_4.4.0-040400.201601101930_i386.deb ”
Thanks for help
Hey! Great blog and posts.
The code written by Michael Murphy is not working that well, I think (though it is a great job!)
I run it and aver typing ‘n’ and ‘n’ to skip the release candidate and the low latency, it downloaded and installed the 4.7.0-040700-generic. However, the latest version is 4.7.2, which was just released 7 days ago according to http://kernel.ubuntu.com/~kernel-ppa/mainline/
Any suggestions on how to get that one?