brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: snap list --all reveals the old revisions you can remove

Snap
~/tips/tip-snap-list-all-remove-old-revisions

snap list --all | awk '/disabled/{print $1, $3}' | while read name rev; do sudo snap remove "$name" --revision="$rev"; done

Finds and removes inactive snap revisions that waste disk space.

Snap keeps older revisions of every snap, and each one uses disk space. The disabled ones are safe to delete.

snap list --all | awk '/disabled/{print $1, $3}'
snap list --all | awk '/disabled/{print $1, $3}' | while read name rev; do sudo snap remove "$name" --revision="$rev"; done

The --all flag includes revisions marked disabled, which are not active but still on disk in /var/lib/snapd/snaps. Run the first line alone to see what it matches. The second line removes each one by name and revision number, which cannot be undone. The active revision is not marked disabled, so the loop skips it, and a removed old revision can no longer be used for snap revert.

Further reading: Managing updates (Snap documentation)

More Snap tips snap refresh --list sudo snap save lxd snap services sudo snap stop --disable lxd.daemon sudo snap alias vlc my-vlc All Snap tips (14) All topics

Link