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?
2 Answers
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 run snap remove snapname but not snap 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:
sudo snap remove <package name> && snap install <package name>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.:
sudo snap remove firefox && snap install firefox 1