Ubuntu 22.04
desktop version comes pre-installed with Snap. However, I find it inconvenient to use and the Snap directory in the Home folder is quite distracting. So, I tried uninstalling it but encountered several issues.
Essentially, the uninstall command would look like this:
sudo apt autoremove --purge snapd gnome-software-plugin-snap
However, when executing this command, I encountered a failure with the following error log:
rm: cannot remove '/var/snap/firefox/common/host-hunspell/en_US.aff': Read-only file system rm: cannot remove '/var/snap/firefox/common/host-hunspell/en_US.dic': Read-only file system
OKAY, let's attempt to remove it ourselves, but unsurprisingly, we encountered another failure due to the 'Read-only file system' error.
I decided to use the lsblk
command, and got the following output:
$ lsblk │ ├─nvme0n1p4 259:4 0 1G 0 part ├─nvme0n1p5 259:5 0 29.3G 0 part /var/snap/firefox/common/host-hunspell │ / ├─nvme0n1p6 259:6 0 8.2G 0 part [SWAP]
This QA's top answer was
snap disconnect firefox:host-hunspell
However, in my case, snap has already been removed. I attempted to reinstall it and execute the above command again, but it did not work.
I uninstalled Snap once again and unmounted /var/snap/firefox/common/host-hunspell
. Subsequently, I proceeded to delete the corresponding folder.
However, the issue persisted. Upon rebooting the machine, I discovered that the mountpoint reappeared.
After a few discovering, I found a file /etc/systemd/system/var-snap-firefox-common-host\x2dhunspell.mount
Here is the content:
[Unit] Description=Mount unit for firefox, revision 2356 via mount-control After=snapd.mounts-pre.target Before=snapd.mounts.target Before=local-fs.target [Mount] What=/usr/share/hunspell Where=/var/snap/firefox/common/host-hunspell Type= Options=ro,bind,noatime,noexec LazyUnmount=yes [Install] WantedBy=snapd.mounts.target WantedBy=multi-user.target X-SnapdOrigin=mount-control
This is the root cause of the mountpoint.
I tried to rename it:
mv /etc/systemd/system/var-snap-firefox-common-host\\x2dhunspell.mount \ /etc/systemd/system/var-snap-firefox-common-host\\x2dhunspell.mount.fuckoff
After the reboot, everything appears to be functioning well, and it seems safe to remove this file.
Additionally, I noticed the presence of two additional symlinks in multi-user.target.wants
and snapd.mounts.target.wants
directories.
rm -f /etc/systemd/system/var-snap-firefox-common-host\\x2dhunspell.mount.fuckoff \ /etc/systemd/system/multi-user.target.wants/var-snap-firefox-common-host\\x2dhunspell.mount \ /etc/systemd/system/snapd.mounts.target.wants/var-snap-firefox-common-host\\x2dhunspell.mount
All cleaned.
7 Comments
CSylvain · May 13, 2024 at 19:23
It’s much simpler 😁 :
umount “/var/snap/firefox/common/host-hunspell”
apt-get remove –purge snapd
apt-get autoremove –purge
CSylvain · May 13, 2024 at 19:28
One last order forgotten :
systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount
rm “/etc/systemd/system/var-snap-firefox-common-host\\x2dhunspell.mount”
Yu · May 16, 2024 at 21:04
Thank you for sharing.
The key issue here is that the systemd service `var-snap-firefox-common-host-hunspell.mount` has a problematic dependency within the deb package. In theory, it should be dependent on the removal of snapd and then executed within a `prerm` script.
I only became aware of the problem after I had already uninstalled snapd without any prior knowledge.
Papa · December 27, 2023 at 03:19
Excellent! Works wonderfully :)
Yu · December 27, 2023 at 18:02
Cool! Thank you~
guest · October 24, 2023 at 20:41
thank you, it works.
Yu · October 25, 2023 at 11:27
Thank you for your comment! I’m glad the solution worked for you.