Word to the wise: I committed a serious error in snap, and hereâs what I did to come back from it.
I originally installed Nextcloud 14 from the 14/candidate channel with the command:
snap install --channel=candidate/14 nextcloud
Then I wanted to see if any security updates could be had by trying to refresh the snap manually, not understanding that these updates (called âAuto-Refreshesâ) happen automatically! With snap, there is no such equivalent to âapt-get update && apt-get upgradeâ.
So I stupidly ran the command:
snap refresh --stable nextcloud
âŚwhich effectively downgraded my Nextcloud 14 to 13 (and the snap command doesnât tell you what the before-and-after versions of Nextcloud are, it just successfully completes the command, with rather poor verbosity)! I was not warned that I was effectively about to do something stupid, namely the downgrade from 14 to 13 (and I would have appreciated a suggestion that I might want to cancel that idea before continuing on). Then Nextcloud was left totally unusable. So next I ran the command:
snap revert nextcloud
âŚwhich reverted back to 14. Then Nextcloud worked again as before. Whew! But I was not out of the woods yet. Then snapdâs âAuto-Refreshâ feature âhelpfullyâ âupgradedâ me back to 13, not long after (as the âchannelâ was still set to âstableâ)! So Nextcloud magically stopped working again. I wanted to strangle Mark Shuttleworth very badly at that time!
So I ran the command:
snap install --channel=candidate/14 nextcloud
âŚagain, to try to set the channel back to 14/candidate. Sorry, no can do, as itâs already installed!
Here is the magical command which fixed it all. After doing another âsnap revert nextcloudâ (to get back to 14) you have to run:
snap switch --channel=14/candidate nextcloud
Also helpful were the commands:
snap changes
âŚwhich revealed that the âAuto-Refreshesâ were happening (which kept automatically downgrading my Nextcloud to 13, behind my back), as well as:
snap list --all
âŚwhich showed me how I had both Nextcloud 14 and 13 installed at once (and 14 got âdisabledâ, and could be potentially be reverted to, after a downgrade to 13). It was here where I eventually realized I needed to get the âTrackingâ column to be set back to â14/candidateâ, not âstableâ, for the ânextcloudâ line.
I also removed the disabled Nextcloud 13 snap (as a final cleanup step) with the command:
snap remove --revision=9868 nextcloud
How did I know that Rev 9868 needed to be removed? Because that was the âRevâ listed for Nextcloud 13 in the âsnap list --allâ command.