Tools: TIL: Snaps Are Secretly Eating Your Disk Space (Here’s How to Fix It) 🐧 (2026)

Tools: TIL: Snaps Are Secretly Eating Your Disk Space (Here’s How to Fix It) 🐧 (2026)

The "Secret" Snap Stash 📦

The Solution: Cleaning Up Old Snaps 🧹

Bonus: Don't Forget Flatpak! 🧽

The Result 📈 If you use Linux as your daily driver, you’ve probably noticed your root partition quietly shrinking over time. You run ncdu or df -h, poke around your directories, and wonder: Where did all my storage go? Today I Learned (TIL) that a massive chunk of that missing space might be hiding in plain sight. Package managers like Snap and Flatpak are incredibly convenient for cross-distribution app installations. However, Snap has a habit of hoarding. By default, Snap secretly keeps the last 2 or 3 versions of every single application you install. The logic behind this is sound: if a new update breaks an app, you can easily roll back to the previous working version. But over time? This "just in case" feature wastes gigabytes of valuable disk space, keeping obsolete binaries on your system indefinitely. You can easily reclaim this space by removing the old, "disabled" versions of your snaps. Instead of doing this manually one by one, here is a handy bash script that automates the cleanup: While you're doing spring cleaning, you should check on your Flatpaks, too. Flatpak doesn't hoard app versions the same way Snap does, but it does leave behind orphaned runtimes (dependencies) when you uninstall apps. You can purge all unused Flatpak runtimes with one simple command: Running these two snippets on a machine that hasn't been cleaned in a year can easily free up anywhere from 2GB to 10GB+ of space. If you just ran this on your machine, drop a comment below—I'm curious to see who holds the record for the most gigabytes reclaimed! 👇 Do you have any other favorite Linux cleanup commands? Let's hear them in the comments! Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

#!/bin/bash set -eu # Find all disabled snaps and -weight: 500;">remove them -weight: 600;">sudo snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do -weight: 600;">sudo snap -weight: 500;">remove "$snapname" --revision="$revision" done #!/bin/bash set -eu # Find all disabled snaps and -weight: 500;">remove them -weight: 600;">sudo snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do -weight: 600;">sudo snap -weight: 500;">remove "$snapname" --revision="$revision" done #!/bin/bash set -eu # Find all disabled snaps and -weight: 500;">remove them -weight: 600;">sudo snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do -weight: 600;">sudo snap -weight: 500;">remove "$snapname" --revision="$revision" done flatpak uninstall --unused flatpak uninstall --unused flatpak uninstall --unused - snap list --all lists every snap installed, including the inactive older versions. - awk '/disabled/{print $1, $3}' filters that list to only grab the names and revision numbers of the snaps marked as "disabled". - The while loop iterates through them and safely runs the snap -weight: 500;">remove command for those specific old revisions.