19

In Ubuntu 22.04 the firefox snap was installed as default. I just removed it using the command sudo snap remove firefox but inside the file computer/var/lib/snapd/seed/snaps there exists an firefox snap locked package weighing about 163 mb how can I remove that

the package with it's location

1

4 Answers 4

53

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
7
  • 5
    Thanks, you are a life saver!
    – Mooncake
    Dec 1, 2022 at 22:58
  • 4
    @Mooncake I'm glad to hear that my "journey" is saving valuable time for others, thanks for the feedback. Dec 2, 2022 at 6:25
  • 1
    thanks a lot you saved the day. Jan 26, 2023 at 14:14
  • 1
    Thank you very much! It worked flawlessly!
    – dharman
    Feb 2, 2023 at 9:08
  • 1
    thank this work!
    – gandalivs
    Jul 22, 2023 at 1:51
11

You used sudo snap remove firefox but you should have used

  • snap disable firefox
  • snap remove --purge firefox

reference

7
  • 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, 2022 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, 2022 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, 2022 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, 2022 at 12:22
  • 1
    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) Oct 8, 2022 at 0:32
7

The following commands can be used to remove Firefox snap:

sudo umount /var/snap/firefox/common/host-hunspell
sudo snap remove firefox
2
  • Minor typo - umount. Jan 1, 2023 at 7:22
  • Thank you. This was the correct solution for me.
    – Kai Dijon
    Jan 23, 2023 at 5:12
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .