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

Sorin Srbu sorin.srbu at ki.se
Fri Dec 22 14:23:18 UTC 2023


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.

-- 
//Sorin Srbu, Serverdrift
Tele: 08-524 84166
Karolinska Institutet Universitetsbibliotek
Avdelningen för Verksamhetsstöd
Enheten för Teknikstöd och Bildproduktion

---

Link to public OpenPGP key:
https://kise-my.sharepoint.com/:u:/g/personal/sorin_srbu_ki_se/EWQ7XJEA4q9Fg-flWAM77sUB8mZKScXse3e5vkBdqOnblQ?e=gGTgUY


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20231222/173b8043/attachment.sig>


More information about the ubuntu-users mailing list