Last active
June 16, 2017 15:20
-
-
Save renaudcerrato/d1d3dc2e7f49d86a808ff020a7b0eb88 to your computer and use it in GitHub Desktop.
Easily install Ubuntu linux kernels.
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 | |
set -e | |
BASEURL=http://kernel.ubuntu.com/~kernel-ppa/mainline | |
BUILDIR=${BUILDIR:-$HOME/.build} | |
ARCH=$(dpkg --print-architecture) | |
VERSIONS=$(curl -s $BASEURL/ | sed -n 's/.*href="v\([^/"]*\).*/\1/p' | grep -v rc | sort -t. -k 1,1rn -k 2,2rn -k 3,3rn | head -n 100) | |
MENU=() | |
for VERSION in $VERSIONS; do | |
MENU+=($VERSION $VERSION) | |
done | |
VERSION=$(whiptail --notags --title $(uname -r) --menu "Kernel version?" 18 60 10 "${MENU[@]}" 3>&1 1>&2 2>&3) | |
ARCHIVES=$(curl -s $BASEURL/v${VERSION}/ | sed -n 's/.*href="\([^"]*\.deb\).*/\1/p' | grep -e "all\|$ARCH" | grep -v lowlatency | sort -u) | |
mkdir -p $BUILDIR | |
for deb in $ARCHIVES; do | |
[ -f $BUILDIR/$deb ] || wget -P $BUILDIR $BASEURL/v${VERSION}/$deb | |
sudo dpkg -i $BUILDIR/$deb | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment