Skip to content

Instantly share code, notes, and snippets.

@clamytoe
Last active November 7, 2019 13:04
Show Gist options
  • Save clamytoe/a465289d33d612a745a4540d6bf3675e to your computer and use it in GitHub Desktop.
Save clamytoe/a465289d33d612a745a4540d6bf3675e to your computer and use it in GitHub Desktop.
Small script to check what kernels are installed with a note on how to remove unwanted ones.
#!/bin/bash
clear
echo "##################"
echo "# CURRENT KERNEL #"
echo "##################"
echo ""
uname -r
echo ""
echo "######################"
echo "# INSTRALLED KERNELS #"
echo "######################"
echo ""
dpkg --list | grep linux-image | awk '{print $2}'
echo ""
echo "######################"
echo "# INSTRALLED HEADERS #"
echo "######################"
echo ""
dpkg --list | grep linux-headers | awk '{print $2}'
echo ""
echo "Remove unwated kernels with:"
echo " sudo apt autoremove"
echo " sudo apt-get purge linux-image-x..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment