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 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
sudo is also necessary for the command after &&. Without sudo, snap will ask for the password using a GUI window.
– Melebius
Jun 06 '24 at 07:13
snap savedworks even aftersnap remove someAppand thensnap install someApp! :) BTW: the "ID" of the snap is in the "Set" column (the first one) of the list you get fromsnap saved- that was super not-obvious for me :) – jave.web Nov 08 '20 at 03:01vscode? I've to reinstall it without downloading it again due to low data balance. I installed it withsnaponubuntu18.04. – y_159 Jul 11 '21 at 06:17snap remove codeand thensnap install code. It will reinstall without downloading again correct? – y_159 Jul 11 '21 at 12:32