32

In Ubuntu 22.04 the Firefox snap was installed by default. I removed it using the command sudo snap remove firefox, but inside the filesystem in /var/lib/snapd/seed/snaps there exists a Firefox snap locked package which is about 163MB in size. How can I remove that?

enter image description here

karel
  • 122,695
  • 134
  • 305
  • 337
ABHILASH T
  • 2,683
  • 3
  • 9
  • 13
  • This worked like a charm. Hope it helps you like it helped me. https://ubuntuhandbook.org/index.php/2022/04/install-firefox-deb-ubuntu-22-04/amp/ – wileyCoyote Jan 11 '23 at 21:24

4 Answers4

69

Warning: The following command will remove Firefox completely - including the locally saved profile.


For those who get the error in Ubuntu 22.04:

$ sudo snap remove --purge firefox
error: cannot perform the following tasks:
- Remove data for snap "firefox" (1943) (unlinkat /var/snap/firefox/common/host-hunspell/en_ZA.dic: read-only file system)

Verify that indeed /var/snap/firefox/common/host-hunspell is mounted as an ext4 file system using lsblk -fe7 -o+ro

If so, stop the Firefox service

$ sudo systemctl stop var-snap-firefox-common-host\\x2dhunspell.mount
$ sudo systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount 
Removed /etc/systemd/system/default.target.wants/var-snap-firefox-common-host\x2dhunspell.mount.
Removed /etc/systemd/system/multi-user.target.wants/var-snap-firefox-common-host\x2dhunspell.mount.

Then the uninstall command should work:

sudo snap remove firefox
  • 4
    @Mooncake I'm glad to hear that my "journey" is saving valuable time for others, thanks for the feedback. – Yogev Neumann Dec 02 '22 at 06:25
  • BE VERY CAREFUL WITH --purge! IT WILL DELETE BOTH THE PROFILE IN YOUR SNAP FOLDER AND ITS BACKUP. – J. Mini Feb 10 '24 at 23:21
  • @J.Mini the question was how to "Completely remove firefox snap package", but thanks for pointing that out, I've added a warning about that in my answer. – Yogev Neumann Sep 24 '24 at 15:59
  • 1
    It is insane I need to do this every Ubuntu upgrade. It is infuriating, it's like an undead zombie. It keeps popping up. – odinho - Velmont Oct 16 '24 at 12:14
18

You used sudo snap remove firefox but you should have used

  • snap disable firefox
  • snap remove --purge firefox

reference

graham
  • 13,289
  • So do I need to install firefox once again using that snap package installing it via software installer then using the above commands – ABHILASH T Jun 15 '22 at 15:38
  • Once removed, you can install the APT version if you prefer (or re-install the snap). The instructions to install the APT version are in the reference link provided in my answer. – graham Jun 15 '22 at 17:41
  • Ok, since I purged the firefox I cannot install that package again from seed directory using software installer, so if I install it from software centre an snap version can I completely remove the seed file by using above command. – ABHILASH T Jun 17 '22 at 12:20
  • I followed the instructions in my answer and Firefox is still available in Ubuntu Software as a snap so your comment seems not to make sense – graham Jun 17 '22 at 12:22
  • No, I meant installing the firefox for the above package again which I shown in the image in the original question, so if I install firefox snap again from the Ubuntu software centre again and in terminal if I execute the command sudo snap disable firefox && snap remove --purge firefox will I be able to remove the firefox fully even from seed library – ABHILASH T Jun 18 '22 at 14:22
  • I really don't understand your question about the seed library. To state again; I performed the command as written and Firefox is still available as a snap should I wish to download it as such. – graham Jun 19 '22 at 11:56
  • 2
    snap remove --purge firefox gave me an error: error: cannot perform the following tasks:
    • Remove data for snap "firefox" (1918) (unlinkat /var/snap/firefox/common/host-hunspell/en_US.dic: read-only file system)
    – user2616155 Oct 08 '22 at 00:32
  • with Ubuntu 24.04 this partly works: Since hunspell remains in place & active the firefox removal does not complete. You still have to disable / unmount / purge the hunspell as descibed here in different ways. So yes, your hint is very welcome but it does not resolve the hunspell obstacle. – opinion_no9 Aug 12 '24 at 19:11
  • 1
    Your suggestion was very helpful and I gave an up vote. Now when I do snap remove --purge firefox, it tells me firefox removed. Great! Still I see the firefox icon in the list when I click the icon in the lower left hand corner. If it is removed, why the icon still remain? – Ilan Mar 23 '25 at 14:34
  • @Ilan do you also have the .deb version installed? apt list --installed – graham Mar 23 '25 at 15:19
  • 1
    I found the problem. I had to go to /var/lib/snapd/desktop/applications. There I deleted the firefox desktop entry. Now all is well. Thanks for the help – Ilan Mar 23 '25 at 16:07
10

The following commands can be used to remove Firefox snap:

sudo umount /var/snap/firefox/common/host-hunspell
sudo snap remove firefox
Artur Meinild
  • 31,385
mosomedve
  • 101
3

Files in that folder (/var/lib/snapd/seed/snaps) came pre-installed with the operating system. No snap command will remove them. Deleting them manually will remove them, but can potentially break something eventually maybe. If you won't be using the firefox snap, most likely it's fine to just manually delete the file, but there is always the potential that it may break something later.

If you want to install Firefox as a .deb, you can follow the instructions here to install the Mozilla PPA and prevent apt from "updating" to a snap automatically.

Esther
  • 3,932