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.
snap saved
works even after snap remove someApp
and then snap install someApp
! :) BTW: the "ID" of the snap is in the "Set" column (the first one) of the list you get from snap saved
- that was super not-obvious for me :)
vscode
? I've to reinstall it without downloading it again due to low data balance. I installed it with snap
on ubuntu18.04
.
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.