Firefox and App center stopped working on Ubuntu 23.10

As the title says, firefox stopped working, the app center stopped working and after a little digging i found that the problem was with snaps (or so i think). I followed some instructions to try to start snapd, with no successs. I tried to gather some logs, it would be very appretiated if someone more experienced can help me solve this issue.

sudo journalctl --no-pager -u snapd

resulting log:

This line makes me think that perhaps your state.json is corrupt.

Feb 18 11:13:56 pedroPC-A320MH snapd[1005]: cannot run daemon: cannot read state: invalid character '#' looking for beginning of value

In theory you should be able to sudo rm /var/lib/snapd/state.json and snapd should re-create it. But wait for another expert to confirm that.

1 Like

I thought you were probably correct about the corruption, so I moved the state.json to my home folder and rebooted. This somewhat worked, but i still had no access to the snap store. I, then, found out that ubuntu’s appstore was itself installed as a snap (!!), so I ran

snap remove snap-store

which replied with: error: cannot perform the following tasks:

1353 - Remove data for snap “snap-store” (959) (failed to remove snap “snap-store” base directory: remove /var/snap/snap-store: directory not empty)

the folder mentioned was empty, so i just manually deleted it and reinstalled the snap-store snap with: sudo rm -rf /var/snap/snap-store/

sudo snap remove snap-store

sudo snap install snap-store

which seems to have restored the system to working condition, although some gnome icons randomly reverted to the gnome default, instead of the ubuntu ones :thinking: