Purging snapd fails due to the hunspell mount

Bug #1998710 reported by Alkis Georgopoulos
26
This bug affects 6 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Purging snapd fails with "Read-only file system" errors due to the hunspell mount.
Workaround: run `snap remove firefox` before `apt purge snapd`.

Failure sample:

# apt purge snapd

The following packages will be REMOVED:
  snapd*
...
Removing snap firefox and revision 1635
rm: cannot remove '/var/snap/firefox/common/host-hunspell/en_GB.dic': Read-only file system
...
dpkg: error processing package snapd (--purge):
 installed snapd package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Mario (mario-gleirscher) wrote :

A few weeks ago, I removed the firefox snap and replaced it with firefox deb. The snap removal with
sudo snap remove firefox
caused an error message mentioning a mount to the hunspell directory. I ignored that for the time being.

Because snap is continuously reminding me of updates, I also wanted to remove snap entirely with
sudo apt purge snapd
as nicely discussed at
https://askubuntu.com/questions/1280707/how-to-uninstall-snap

But then I got the above error message. What can I do instead of waiting for a bugfix, given that is a bug in the first place?

The discussion at
https://forum.snapcraft.io/t/sdb5-mounted-on-firefox/31897
was somewhat helpful to understand the complexity of that problem but didn't help me much in figuring out what to do.

So, how can I remove the block device manually, especially when it's mounted at the same point as
my root?

nvme0n1 259:0 0 476,9G 0 disk
├─nvme0n1p1 259:1 0 953M 0 part /boot/efi
├─nvme0n1p2 259:2 0 16M 0 part
├─nvme0n1p3 259:3 0 39,1G 0 part /var/snap/firefox/common/host-hunspell
│ /
├─nvme0n1p4 259:4 0 342,2G 0 part /home
├─nvme0n1p5 259:5 0 67,9G 0 part
├─nvme0n1p6 259:6 0 613M 0 part
└─nvme0n1p7 259:7 0 15,6G 0 part [SWAP]

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

While waiting for an answer from the developers,
I would suggest that you try the following:

sudo snap install firefox
sudo snap remove firefox

I assume that the older firefox that you had, had uninstallation issues, which were solved in the more recent version that I tested with.

If that doesn't solve the issue, only then do:

sudo umount /var/snap/firefox/common/host-hunspell

This will manually disconnect the mount, but it won't delete the service from /etc as uninstalling firefox does.

And at that point, you'll be able to do:

sudo apt purge snapd

Revision history for this message
IGHOR (julyighor) wrote :

@alkisg this does not helps.
While I was able to uninstall snapd after umounting the path, it is still re-mounted after reboot.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

@IGHOR, so you ran `sudo snap remove firefox`?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.