7

Ubuntu 16.04 - has a /snap/core folder with subfolders of revisions. Do I need the /snap folder at all?

Can I just remove it (and how)?

4

Snap is package management tool which was Canonical's new package management tool. And this snap package management used by Ubuntu Software Center--I know this because I never use the snap tool but I have 13+ snap folders. That is the reason /snap folder exist, I guess.

And tool name is snapd. So when you want to install or uninstall package, you should use command like this:

sudo apt autoremove snapd

or

sudo apt autoremove --purge snapd

If you are installing software package with apt command or synaptic package manager, you don't need snapd package. So you can remove it.

Ubuntu Software Center will use 'snapd'--that's what happen to me. But after removed snapd, Software Center won't use snapd, it seems.

7

The /snap folder isn't a traditional folder full of files. So you don't really delete the contents of that folder and get space back (if that's what you're expecting). This folder is used when snaps are installed. If for example you installed the Spotify snap then you'd end up with a /var/lib/snapd/snaps/spotify_6.snap file which contains the compressed application and libraries. This gets mounted under /snap/spotify/6 and symlinked as /snap/spotify/current.

The files haven't been uncompressed to that directory, they're just mounted and read at runtime. You can see this with mount | grep spotify, like this:-

/var/lib/snapd/snaps/spotify_6.snap on /snap/spotify/6 type squashfs (ro,nodev,relatime)

The same goes for the core runtime snap, which lives in the same location, and is mounted in a similar way. By default on a clean install of Ubuntu there are no snaps installed, even core. However as soon as you install a snap, you get the core snap pulled in, which contains the runtime low level dependencies needed by all snaps.

While you could unmount the directory and delete the core snap, you'd break all install snaps doing this, and the system will make it hard for you to do that as a result.

  • OK, I just like a clean system, and based on your explanation I have no need for snap. I may have tried to install something in the past, but presently don't have any snap, so I do not need any residual snap files on the system. No, the issue is not space, just pureness. I'll remove the /snap directory from a different boot. – Janos Jan 28 '18 at 2:22
  • 5
    I was able to completely remove it with sudo apt purge snapd ubuntu-core-launcher squashfs-tools – Janos Jan 28 '18 at 2:51
  • Thanks for this comment @Janos. I had 2GB of useless trash in my server removed. – marbel Oct 27 '18 at 14:41
  • 1
    Great! Now I start to understand the snap philosophy, mounting snap packages, etc. My problem is that I used the "Software" program to install and remove stuff and. This, in many instances, created a loit of "snaps". My /var/lib/snapd is full of previously installed and uninstalled programs. My machine start to look line a Vindooz bloatware. I only have presently dosbox, illogically buried away in my ~/snap/dosbox-jz folder. Now, thanks to your latest posting I simply installed dosbox with apt, and will get rid of all traces of snap. Thx! – Janos Jan 22 at 14:16
  • @Janos It was only necessary for me to use sudo apt purge snapd in Ubuntu 18.10 to remove the /snap/ directory. – Patrick Dark Mar 9 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.