How to remove all the firefox (and other) cruft in /snap etc.?

Chris Green cl at isbd.net
Fri Dec 22 14:36:46 UTC 2023


On Fri, Dec 22, 2023 at 02:23:18PM +0000, Sorin Srbu via ubuntu-users wrote:
> 
> On Fri, 2023-12-22 at 13:54 +0000, Chris Green wrote:
> > On Fri, Dec 22, 2023 at 11:20:55AM +0000, Sorin Srbu via ubuntu-users
> > wrote:
> > > On Fri, 2023-12-22 at 09:31 +0000, Chris Green wrote:
> > > > On Fri, Dec 22, 2023 at 07:52:01AM +0000, Sorin Srbu via ubuntu-
> > > > users
> > > > wrote:
> > > > > On Thu, 2023-12-21 at 20:11 +0000, Chris Green wrote:
> > > > > > Having removed snapd from my [x]ubuntu system I had hoped it
> > > > > > would be
> > > > > > really gone, but apparently not, there's loads of stuff in
> > > > > > /snap
> > > > > > and
> > > > > > in the udev rules (/etc/udev.d/snap.firefox.rules) that
> > > > > > haven't
> > > > > > gone.
> > > > > > 
> > > > > > Surely if I purge firefox it should take all this junk with
> > > > > > it.
> > > > > > 
> > > > > > How can I safely clear it out?
> > > > > 
> > > > > Hello,
> > > > > 
> > > > > IIRC, there are parts of the apt-system that uses snapd.
> > > > > Removing snapd might bork your system.
> > > > > 
> > > > I removed snapd several versions ago and have had no problems at
> > > > all.
> > > > It's just the junk below /snap I was wondering about getting rid
> > > > of
> > > > as
> > > > well.
> > > > 
> > > 
> > > Ah, I see. I was a bit too worried to proceed when I saw the apt
> > > stuff.
> > > It might have been nothing though.
> > > 
> > To actually get rid of all that junk in /snap it's a bit more
> > complicated!  You have to reinstall snapd and then use 'snap' to
> > remove all the snap stuff.
> > 
> > So, 'apt reinstall snapd' and reboot the system (to get snapd started
> > and configured).  Then 'snap list' shows you all the installed snap
> > packages.  In my case it was just leftover bits of firefox and its
> > dependencies.  Go through 'snap remove [--purge] <nam>' for each,
> > they
> > have to be done in the right order as some depend on others but it's
> > fairly clear how.
> > 
> > There's a bug when you remove firefox, it can't remove one bit
> > because
> > it's on a read-only filesystem, you have to umount it manually.
> > 
> > Finally 'snap remove --purge snapd' (yes, it can remove itself!)
> > after
> > which 'apt purge snapd' leaves things reasonably cleaned up.  :-)  It
> > even removes the /snap directory.
> 
> 
> Sounds easy enough, but I still don't think I dare!
> However, I might come to a point when I snap and get rid of this
> subsystem altogether.
> 
It also gets rid of all those loop devices that clutter up fdisk and
drive listings, snap really is pain.  Other 'snap like' systems such
as AppImage don't produce all this junk. I only ever used Firefox that
was snap based and stopped using it quite a while ago but I've been
frustrated by the messy snap legacy ever since, until now.  I have
several AppImage based programs (digikam, drawio, vivaldi) but they
cause no issues at all, why can't Ubuntu/Canonical just drop snap,
it's a disaster.

-- 
Chris Green



More information about the ubuntu-users mailing list