#! /bin/sh

# I'd like to see what commands are executed
set -x
# First install last working kernel from my private repository over the broken update
ver=4.9.51-1
aptitude install linux-image-4.9.0-4-amd64=${ver} linux-headers-4.9.0-4-amd64=${ver} linux-headers-4.9.0-4-common=${ver} linux-kbuild-4.9=${ver} linux-compiler-gcc-6-x86=${ver} linux-libc-dev=${ver} linux-libc-dev:i386=${ver} linux-headers-amd64=4.9+80+deb9u2 linux-image-amd64=4.9+80+deb9u2
# Then purge isntallation of broken new version
ver=4.9.65-3+deb9u2
aptitude purge linux-image-4.9.0-5-amd64 linux-headers-4.9.0-5-amd64 linux-headers-4.9.0-5-common
# Now forbid these versions so that they don't bother us next time.
ver=4.9.65-3+deb9u2
aptitude forbid-version linux-image-4.9.0-5-amd64=${ver} linux-headers-4.9.0-5-amd64=${ver} linux-headers-4.9.0-5-common=${ver} linux-kbuild-4.9=${ver} linux-compiler-gcc-6-x86=${ver} linux-libc-dev=${ver} linux-libc-dev:i386=${ver}
ver=4.9.65-3+deb9u1
aptitude forbid-version linux-image-4.9.0-4-amd64=${ver} linux-headers-4.9.0-4-amd64=${ver} linux-headers-4.9.0-4-common=${ver} linux-kbuild-4.9=${ver} linux-compiler-gcc-6-x86=${ver} linux-libc-dev=${ver} linux-libc-dev:i386=${ver}
