brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: snap revert puts a snap back on its previous version

Snap
~/tips/tip-ubuntu-snap-revert

sudo snap revert firefox

Rolls a snap back to the previously installed revision after a bad update.

A snap updated overnight and now something is broken. On a normal package that means hunting for an old .deb. With snaps it is one line.

sudo snap revert firefox

The snap docs say a snap can be reverted to an earlier revision with snap revert, and by default it goes to the previous one. That works because snapd keeps older revisions on disk. The maximum is set by refresh.retain, which accepts values from 2 to 20.

After the revert, I would hold the snap so it does not just update again tomorrow:

sudo snap refresh --hold=24h firefox

That gives upstream a day to fix whatever broke, and gives me a working app in the meantime.

I treat it as an undo button. It buys time, and the real fix is still a newer release from the developer.

Caveat: you can only go back to a revision that is still stored, so a retain value of 2 gives you one step back. And an app’s data may have moved forward with the newer version. If the old revision cannot read it, you are trading one problem for another.

Further reading: Snapcraft: Managing updates, On this site: snap refresh –hold pauses one snap without turning updates off

More Snap tips snap refresh --list sudo snap save lxd snap services sudo snap stop --disable lxd.daemon sudo snap alias vlc my-vlc All Snap tips (14) All topics

Link