Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 2447
Next
In Process

askthedev.com Latest Questions

Asked: September 24, 20242024-09-24T06:59:31+05:30 2024-09-24T06:59:31+05:30In: Ubuntu

Is it advisable to remove files located in /var/lib/snapd/snaps on Ubuntu 20.04?

anonymous user

I’ve been diving into the nuances of Ubuntu 20.04 lately, and I’ve stumbled across a bit of a conundrum that has me scratching my head. So, here’s the thing: I noticed that my system’s storage is creeping up, and I’ve been poking around to see where all the space is going. That’s when I came across the `/var/lib/snapd/snaps` directory. I see it’s filled with files, specifically those snap packages that I installed for various applications.

From what I understand, snaps are a pretty nifty way of managing software on Ubuntu. They allow for easier installation and maintenance, plus they keep apps isolated from each other (which is great for security). However, I’m not sure if all the files in `/var/lib/snapd/snaps` are still necessary.

I mean, I’ve uninstalled some apps that I no longer use, but there are still a bunch of files lingering there. Is it safe to just go in there and delete things? I keep hearing mixed opinions from different forums. Some people swear by cleaning up that directory to free up space, while others say that removing those files can lead to issues, including broken dependencies or corrupt packages.

Also, how does snap management even work after you remove these files? Do they get automatically re-downloaded the next time you try to run the app, or does it mess with the package manager? And what about those versions of snaps that get left behind—do they pile up and take up unnecessary space too?

I’d love to hear from anyone who’s tackled this before. Did you clean out your snaps directory, and if so, what was your experience like? Did it make a difference in your system’s performance or storage? Or did you regret it afterward? I’m just trying to find that balance between keeping my system clean and avoiding any potential headaches. Any advice or stories would be super helpful!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-24T06:59:32+05:30Added an answer on September 24, 2024 at 6:59 am



      Snap Packages and Storage Management on Ubuntu 20.04

      Diving into Snap Packages

      So, it sounds like you’re on the right track trying to figure out what’s eating up your storage space in Ubuntu 20.04. The `/var/lib/snapd/snaps` folder is indeed where all those snap packages are stored, and it’s completely normal for it to pile up a bit over time.

      First off, it’s generally not a good idea to just go in there and delete files manually. That can definitely lead to broken packages or apps, which might end up causing you more headaches than it’s worth. Instead, you can clean up some of that space safely using some built-in snap commands.

      Managing Snap Packages

      You can run this command in your terminal to remove any old versions of snaps you no longer need:

      sudo snap remove --purge 

      But the better command for cleaning up all the unused versions is:

      sudo snap set system refresh.retain=2

      This command tells your system to only keep the last 2 revisions of a snap package. This way, if something goes wrong, you’ll still have a fallback version without cluttering your storage with old ones.

      What Happens After Removal?

      If you uninstall a snap completely, then that specific version will indeed get removed. If you try to run an app that’s been removed but still have some versions left, it’s possible it will just pull from what’s stored, or it might throw an error if none are available. So backing up any important apps or files is a good practice.

      My Experience

      When I first started with snaps, I had the same concerns about storage. I went ahead and cleaned it out a bit, but I stuck to the commands instead of going on a deleting spree. Honestly, it freed up a decent amount of space without any issues. Just remember, every case is a bit different, so always check what you really need before you delete anything.

      In summary, avoid manual deletions if you can. Utilize the snap commands to maintain your snaps, and keep an eye on those versions. It should help keep your system clean without running into issues!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-24T06:59:32+05:30Added an answer on September 24, 2024 at 6:59 am

      When dealing with the `/var/lib/snapd/snaps` directory on Ubuntu 20.04, it’s important to approach the cleanup of snap packages with caution. Although snaps provide a convenient way to install and manage applications, they can accumulate over time, especially with retained versions after uninstallation. Simply deleting files from this directory is not recommended, as it can lead to issues such as broken dependencies and potentially corrupt packages. Snap management is designed so that the system keeps track of available versions for installed applications, and removing files manually could disrupt this mechanism. Instead, you should utilize the built-in commands to manage your snaps more effectively.

      You can remove old and unused snap versions by using the command `snap remove ` for specific apps, or to clean up old versions of installed snaps, you can run `sudo snap set system refresh.retain=2`, which will keep only the latest two versions. This prevents older versions from piling up and consuming excess disk space. After cleaning up, if you attempt to run an app that was previously uninstalled, the snap package manager will automatically ensure the appropriate version is available, either by recreating it or downloading it anew if needed. Therefore, managing your snaps responsibly will help maintain a leaner system without risking the integrity of your applications or experiencing a decline in performance.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this issue?
    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?
    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. Has anyone experienced this issue ...
    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?
    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else encountered this problem, and what ...

    Sidebar

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this ...

    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?

    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. ...

    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?

    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else ...

    • How can I configure a server running Ubuntu to bind specific IP addresses to two different network interfaces? I'm looking for guidance on how to ...

    • Is it possible to configure automatic login on Ubuntu MATE 24.04?

    • After upgrading from Ubuntu Studio 22.04 to 24.04.1, I lost all audio functionality. What steps can I take to diagnose and resolve this issue?

    • I am experiencing issues booting Ubuntu 22.04 LTS from a live USB. Despite following the usual procedures, the system fails to start. What steps can ...

    • I'm encountering a problem with my Expandrive key while trying to update my Ubuntu system. Has anyone else faced similar issues, and if so, what ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.