I would like to reinstall a snap package due to a missing library file (removing and installing the snap again fixed this problem on another system).
How can I avoid the uninstall step (thus preserving my settings) and install again?
I would like to reinstall a snap package due to a missing library file (removing and installing the snap again fixed this problem on another system).
How can I avoid the uninstall step (thus preserving my settings) and install again?
Unfortunately a command or option to reinstall a snap similar to
apt install --reinstall
does not exist. So removing and then installing the snap again is the only way.But the settings of the snap will be saved in a snapshot while removing the snap unless you use the
--purge
-option, so just runsnap remove snapname
but notsnap remove --purge snapname
.Check the snapshot with
snap saved
to see it's ID.After installing the snap again you can restore the snapshot with
snap restore ID
and your settings are back.You can use a command like this:
Because there is no reinstall option in snap package manager, we have to combine uninstall and install commands inorder to perform reinstallation in a single step, eg.: