1

Snaps are missing. I'd like to reinstall, but I can't seem to remove them first in order to reinstall. How do I fix this?

$ chromium-browser
cannot locate base snap core18: No such file or directory

$ snap list
Name                  Version                     Rev    Tracking         Publisher    Notes
chromium              87.0.4280.88                1421   latest/stable    canonical✓   -
core                  16-2.48                     10444  latest/stable    canonical✓   core
core18                20200929                    1932   latest/stable    canonical✓   base
gnome-3-26-1604       3.26.0.20200529             100    latest/stable/…  canonical✓   -
gnome-3-28-1804       3.28.0-19-g98f9e67.98f9e67  145    latest/stable    canonical✓   -
gnome-3-34-1804       0+git.3556cb3               60     latest/stable    canonical✓   -
gnome-system-monitor  3.36.0-12-g35f88a56d7       148    latest/stable/…  canonical✓   -
gtk-common-themes     0.1-50-gf7627e4             1514   latest/stable/…  canonical✓   -
snap-store            3.38.0-55-geb45541          498    latest/stable/…  canonical✓   -

$ sudo snap install core18
snap "core18" is already installed, see 'snap help refresh'

$ sudo snap remove core18
error: cannot remove "core18": snap "core18" is not removable: snap is being used by snaps
       chromium, gnome-3-28-1804, gnome-3-34-1804, gnome-system-monitor and 2 more.

$ snap version
snap    2.48+20.04
snapd   2.48+20.04
series  16
ubuntu  20.04
kernel  5.4.0-56-generic

mghicks
  • 145
  • 2
  • 6

3 Answers3

4

You can Refresh the snap. If you face an error like

snap "core18" has no updates available

You can force refresh by switching to edge tracking branch temporarily

snap refresh core18 --edge

And then, when the problem is fixed, switch it back to stable tracking branch

snap refresh core18 --stable
acid7
  • 66
  • 2
1

Refreshing might help:

sudo snap refresh core18

snap help refresh:

The refresh command updates the specified snaps, or all snaps in the system if none are specified.

Pablo Bianchi
  • 14,308
  • 4
  • 74
  • 117
1

Removing all the dependencies allows core18 to be removed, then installed again. This wasn't as disruptive as I thought it might be.

My chromium config after Feb 29, 2020 was lost. I specifically made a backup of ~/.config/chromium, but that directory only seemed to include config up to that date.

mghicks
  • 145
  • 2
  • 6
  • 1
    The config files for snaps are not in `~/.config` but in `~/snap`. If you remove a snap, a snapshot will be taken unless you use the `--purge`-option. You should be able to restore a snapshot. You can check for snapshots with `snap saved` and restore with `snap restore ID`. See https://askubuntu.com/a/1231238/590937 and `man snap`. The config for chromium you had in `~/.config/chromium` is most likely the config from older chromium version when chromium was still a deb and not a snap. – mook765 Jun 30 '22 at 12:43