Cannot locate base snap core22 – easy fix

A co-worker came to me recently because they had an Ubuntu Linux 22.04 computer on which restored a “Timeshift” backup, but suddenly Firefox wasn’t working. How or why it became corrupted was beyond me, but by the time I was ‘called in’ he had already tried several troubleshooting techniques, which had only seemed to make things worse. He had tried resetting, removing, and purging Firefox, and as other errors popped up they became things like cannot locate base snap core 22, or something about an inability to run certain hooks. I honestly didn’t even get a shot of the error message, but the good news was, that I had a fix.

The simple fix for this is to have your core runtime environment (the Core 22 base snap, or Core 20, or any other core you may be having this issue with) switch over to the beta branch, and then immediately switch it back to the production / stable branch. Two quick commands will take care of this:

sudo snap refresh --beta core22
sudo snap refresh --stable core22

Once finished, you can simply reinstall your problem snap: sudo snap install firefox – and then it began redownloading and reinstalling correctly.