Created
July 17, 2017 02:47
-
-
Save maietta/243a3086246e5441cd2e5f76532bb85f to your computer and use it in GitHub Desktop.
One liner to clean up /boot on Ubuntu/Debian
This file contains hidden or 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
sudo apt-get purge $(for tag in "linux-image" "linux-headers"; do dpkg-query -W -f'${Package}\n' "$tag-[0-9]*.[0-9]*.[0-9]*" | sort -V | awk 'index($0,c){exit} //' c=$(uname -r | cut -d- -f1,2); done) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment