Bottom Line: You can safely delete old, disabled Snap package revisions in Ubuntu. By default, Canonical’s Snap package manager keeps up to 3 older versions of every installed app, which wastes 2 GB to 10 GB+ of drive space.
What is the Ubuntu Snap Cache Folder?
Located at /var/lib/snapd/snaps, this directory stores downloaded .snap package files for applications installed via Snap (such as Firefox, Chromium, VS Code, Spotify, or VLC).
When a Snap application updates in the background, Snap does not delete the previous package version. Instead, it retains old versions as backups in case you need to revert to a prior software revision. Over time, having multiple revisions of heavy apps like VS Code or Chromium consumes gigabytes.
Can You Delete Old Snap Revisions?
✅ Yes, it is 100% safe to remove disabled revisions.
- Active apps stay working: Your currently active Snap application versions are unaffected.
- Frees space: Removing disabled revisions reclaims disk space on smaller Linux server or laptop SSDs.
How to Safely Clean Up Old Snap Packages
Method 1: Set Snap Retention Limit to 2 Revisions (Permanent Fix)
Run this command in terminal to force Snap to store a maximum of 2 package revisions instead of 3:
sudo snap set system refresh.retain=2
Method 2: Script to Delete All Disabled Snap Revisions (Instant Cleanup)
Run the following Bash one-liner script to remove all disabled/old snap packages automatically:
sudo snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
What Happens After You Run It?
- You instantly reclaim 2 GB to 10 GB of space in
/var/lib/snapd/snaps. - All installed Snap applications continue to open and run normally.
Related Guides
- Learn about cleaning Linux /var/log & journalctl.
- How to shrink [WSL2 virtual disk (ext4.vhdx)].
- Check if you can clean Docker overlay2.
Discussion
Loading authentication...