Exclusive Content:

Haiper steps out of stealth mode, secures $13.8 million seed funding for video-generative AI

Haiper Emerges from Stealth Mode with $13.8 Million Seed...

Running Your ML Notebook on Databricks: A Step-by-Step Guide

A Step-by-Step Guide to Hosting Machine Learning Notebooks in...

“Revealing Weak Infosec Practices that Open the Door for Cyber Criminals in Your Organization” • The Register

Warning: Stolen ChatGPT Credentials a Hot Commodity on the...

Clear Disk Space by Deleting Old Snap Versions

Freeing Up Disk Space on Ubuntu: How to Manage Snap Revisions

Understanding Snap Revisions and Their Importance

Checking Disk Usage: Identifying Space Hogs

A Step-by-Step Guide to Removing Disabled Snap Revisions

The Temporary Nature of Snap Cleanup: What to Expect

Running Out of Disk Space on Ubuntu? Check Your Snap Revisions!

If you’ve ever received those dreaded low disk space warnings on your Ubuntu system, particularly on a modest 40GB partition, you know the feeling of impending panic. The usual troubleshooting tips—like clearing caches or uninstalling applications—can feel inefficient. Recently, I stumbled upon a significant source of wasted space: old Snap revisions.

After opening the Disk Usage Analyzer and running sudo du -sh /var/lib/snapd, I discovered that nearly 8GB was consumed by outdated Snap versions. These versions, remnants of every Snap application I’ve installed, were idly taking up space “just in case” I needed to roll back—something I’ve never actually done.

Why Snap Revisions Exist (and Why You Should Keep Some)

Before we dive into the cleanup process, let’s understand why Snap revisions exist and why having a couple can be beneficial.

Many users might be tempted to use scripts available online to automatically remove all disabled Snap revisions. While this approach may seem handy, it indiscriminately removes every backup, which is risky—especially for critical applications like kernels and drivers. If you’re comfortable with the risk, feel free to go that route, but a manual approach gives you greater control over what gets removed.

Snapd retains two versions of all Snap applications. This ensures that if an update causes issues, you have a reliable backup to roll back to. The silent background updates of snaps make this functionality especially useful, particularly in industrial, IoT, and edge computing environments, where stability is crucial.

For those of us with space constraints, however, an 8GB “worst-case” backup might feel excessive.

Checking What’s Taking Up Space

To get started, you’ll want to examine what specifically is eating up your precious disk space. Use the following command in your terminal:

sudo snap list --all

This command provides a comprehensive list of all installed Snaps, including cores, runtimes, and drivers, along with their revision numbers and active/disabled statuses. Although this command doesn’t return size data, you can use another command to assess the total disk usage:

sudo du -sh /var/lib/snapd

For a more visual representation, I recommend using the Disk Usage Analyzer and navigating to /var/lib/snapd/snaps. This method will display not only the sizes but also the dates of the various Snap versions, giving you insight into how old the disabled versions are.

Removing Disabled Snap Revisions

Once you’ve identified the Snap revisions you want to delete, the next step is removal—proceed with caution! Return to your terminal and execute the following command, but replace 0000 and snap-name accordingly:

sudo snap remove --revision=0000 snap-name

Before hitting enter, double-check your revision number and Snap name. There’s no confirmation prompt, so it’s easy to make a mistake.

For clarity, I recommend using two terminal windows: keep one open with the list of Snap revisions while you perform the removal in another. This helps focus your attention and minimizes errors.

This Is Not a Permanent Fix

It’s important to note that this is not a one-time solution. As new versions of installed Snaps are updated, old revisions will start to pile up again. Periodic cleanup sessions will be necessary, especially if you commonly use Snap applications.

If space is a critical issue for you and you’re reliant on Snaps, taking this time to manage Snap revisions is well worth it. On systems with multiple Snap installations, you might be shocked to find your Snap folder consuming gigabytes of space!

Conclusion

Keeping your Ubuntu file system clean and efficient can feel like a constant battle, but managing Snap revisions is a manageable task that can free up a significant amount of space. Have you ever faced issues with disk space due to Snap revisions? What strategies do you use to tackle this problem? Let me know in the comments!

Latest

A Practical Guide to Using Amazon Nova Multimodal Embeddings

Harnessing the Power of Amazon Nova Multimodal Embeddings: A...

Quick Updates: Career Insights, Smart Cameras, and ChatGPT Highlights

Cambridge vs. Oxford: ChatGPT's Unexpected Insights and Local Headlines A...

How Agentic AI is Transforming Tax and Accounting Practices

Transforming Tax Professionals: The Rise of Agentic AI in...

Empowering Mental Health: How Pharma Can Guide the Rise of AI Chatbots for Patients

Harnessing AI for Mental Health: A Unique Opportunity for...

Don't miss

Haiper steps out of stealth mode, secures $13.8 million seed funding for video-generative AI

Haiper Emerges from Stealth Mode with $13.8 Million Seed...

Running Your ML Notebook on Databricks: A Step-by-Step Guide

A Step-by-Step Guide to Hosting Machine Learning Notebooks in...

VOXI UK Launches First AI Chatbot to Support Customers

VOXI Launches AI Chatbot to Revolutionize Customer Services in...

Investing in digital infrastructure key to realizing generative AI’s potential for driving economic growth | articles

Challenges Hindering the Widescale Deployment of Generative AI: Legal,...

Faith: Sacred Ground, Celestial Sounds

Embracing the Holy Sound of Children in Church: A Reflection on Understanding Holiness Through Their Eyes Embracing the Sacredness of Space: A Reflection on Children...

North East Delegation Heads to the US to Promote Region’s Space...

Space North East England Delegation Arrives in Orlando for Florida Commercial Space Week Space North East England Delegation Touches Down in Orlando for Florida Commercial...

NASA Postpones Moon Rocket Launch by One Month Due to Fuel...

NASA Postpones Historic Artemis II Lunar Mission Due to Rocket Test Issues NASA Delays Artemis II Mission: A Setback on the Journey Back to the...