Skip to content

Instantly share code, notes, and snippets.

@rizqikazukun
Created September 29, 2021 00:48
Show Gist options
  • Save rizqikazukun/eecfbca2aaca62990c6986b944df0bc7 to your computer and use it in GitHub Desktop.
Save rizqikazukun/eecfbca2aaca62990c6986b944df0bc7 to your computer and use it in GitHub Desktop.
This is bash script for removing unused snap package
#!/bin/sh
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
# Source : https://askubuntu.com/questions/1036633/how-to-remove-disabled-unused-snap-packages-with-a-single-line-of-command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment