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

Jeffrey Walton noloader at gmail.com
Fri Dec 22 19:28:18 UTC 2023


On Fri, Dec 22, 2023 at 1:53 PM Jeffrey Walton <noloader at gmail.com> wrote:
>
> On Fri, Dec 22, 2023 at 11:08 AM Grizzlly via ubuntu-users
> <ubuntu-users at lists.ubuntu.com> wrote:
> >
> > Friday, December 22, 2023  at 13:54, Chris Green wrote:
> > Re: How to remove all the firefox ( (at least in part)
> >
> > >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.
> >
> > Real Final step (after cleaning up various snap[ish] dirs)
>
> You might also want to manually delete the Systemd units related to
> Snap. When I removed Snap, I also did something like:
>
>     # find /etc/systemd -iname '*snap*' -exec rm -f {} \;
>     # shutdown -r now
>
> Without the Systemd units mounting, you can manually delete a lot of Snap cruft.
>
> > Preventing Snap Installation Through the apt Command
> >
> > $ sudo cat <<EOF | sudo tee /etc/apt/preferences.d/nosnap.pref
> > Package: snapd
> > Pin: release a=*
> > Pin-Priority: -10
> > EOF
>
> I think Ubuntu's "no snap" integration could be a lot better. If you
> apt-get remove it, Ubuntu will try to reinstall it, and you need the
> above workaround.
>
> Packages like Firefox will still regurgitate a message about Snap
> (even when Snap is disabled through pin-priority). I feel like Apt or
> Apt-Get or Aptitude should do better when Snap is disabled or not
> available.
>
> You may need this for Firefox, too:
>
>    $ cat /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
>    deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main
>    # deb-src https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main

Oh, and you will need this if you use the Mozilla Team Firefox PPA:

   $ cat /etc/apt/preferences.d/firefox.pref
   Package: firefox*
   Pin: release o=LP-PPA-mozillateam
   Pin-Priority: 501

   Package: firefox*
   Pin: release o=Ubuntu
   Pin-Priority: -1

Jeff



More information about the ubuntu-users mailing list