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

Kaj Haulrich kaj at haulrich.net
Fri Dec 22 15:44:41 UTC 2023



On 22.12.2023 15.36, Chris Green wrote:
> 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.
> 

I got rid of ALL snap-related things several versions ago, and lived 
happily thereafter. No need for appimages, flatpaks either. Firefox can 
be installed as a deb-package from here:

https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04 


Digikam is available as a normal deb-package from the normal repositories.
I don't know about drawio, though.

Regards
Kaj Haulrich.
--
Sent from my 100% Microsoft-free workstation.
      Running Linux Kubuntu 24.04 LTS




More information about the ubuntu-users mailing list