Skip to content

Instantly share code, notes, and snippets.

@mccarlosen
Created February 22, 2023 02:06
Show Gist options
  • Save mccarlosen/705d1fc7ff4d950ef4ac5e8c6effe501 to your computer and use it in GitHub Desktop.
Save mccarlosen/705d1fc7ff4d950ef4ac5e8c6effe501 to your computer and use it in GitHub Desktop.
Boot partition is full in Linux Mint
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"
sudo apt-get purge $OLDKERNELS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment