Skip to content

Instantly share code, notes, and snippets.

@TotalLag
Forked from mmstick/Ubuntu Kernel Upgrader Script
Last active October 26, 2015 17:54
Show Gist options
  • Save TotalLag/0b3660ae02568f6ef416 to your computer and use it in GitHub Desktop.
Save TotalLag/0b3660ae02568f6ef416 to your computer and use it in GitHub Desktop.
Downloads the generic kernel and installs it.
#!/bin/bash
cd /tmp
if ! which lynx > /dev/null; then sudo apt-get install lynx -y; fi
if [ "$(getconf LONG_BIT)" == "64" ]; then arch=amd64; else arch=i386; fi
function download() {
wget $(lynx -dump -listonly -dont-wrap-pre $kernelURL | grep "$1" | grep "$2" | grep "$arch" | cut -d ' ' -f 4)
}
# Kernel URL
kernelURL=$(lynx -dump -nonumbers http://kernel.ubuntu.com/~kernel-ppa/mainline/ | grep -v -E '(rc|unstable)' | tail -1)
# Download Kernel
echo "Downloading the latest generic kernel."
download generic header
download generic image
# Shared Kernel Header
wget $(lynx -dump -listonly -dont-wrap-pre $kernelURL | grep all | cut -d ' ' -f 4)
# Install Kernel
echo "Installing Linux Kernel"
sudo dpkg -i linux*.deb
sudo update-grub
echo "Done. You may now reboot."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment