Forked from mmstick/Ubuntu Kernel Upgrader Script
Last active
October 26, 2015 17:54
-
-
Save TotalLag/0b3660ae02568f6ef416 to your computer and use it in GitHub Desktop.
Downloads the generic kernel and installs it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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