How to recover from a stuck "auto-refresh" upgrade?

I went to use a snap app this evening (Brave browser, as it happens), but it had disappeared from the launcher. From the command line, I got Command 'brave' not found, but can be installed with: sudo snap install brave

Except, it already is installed… just in case it’s had a problem during an update, I try to install it again, but get:

snap "brave" is already installed, see 'snap help refresh'

However, snap refresh tells me:

All snaps up to date.

So, I do some searching, and discover the snap list command, which shows:

Name                       Version                     Rev    Tracking         Publisher     Notes
brave                      1.26.67                     119    latest/stable    brave         disabled

well, okay then, how about enabling it?

$ sudo snap enable brave

error: snap "brave" has "auto-refresh" change in progress

Oh f*ck off.

I never wanted you to auto-update my software for me, and I certainly didn’t want you to do it unsuccessfully, and leave me unable to use said software.

So:

  1. How do I roll back a failed ‘auto-upgrade’ that, according to snap changes has been ongoing since last night.
  2. How do I turn off / disable auto-upgrades on a global or per-snap basis?

With the change number from snap changes brave, you can abort the auto-refresh with snap abort <chg>

Thank you. I don’t know if that will have worked or not, but tonight I do have brave available again.

Edit:
I just tried this approach for gnome-system-monitor which also seems to be stuck with an auto-refresh change in progress:

sudo snap abort 314

The command completes without any response, and snap changes gnome-system-monitor shows:

ID   Status  Spawn                   Ready                   Summary
311  Error   yesterday at 20:44 IST  yesterday at 20:53 IST  Refresh snap "gnome-system-monitor"
313  Error   yesterday at 20:55 IST  today at 19:43 IST      Refresh snap "gnome-system-monitor"
314  Abort   today at 19:48 IST      -                       Auto-refresh snap "gnome-system-monitor"

However, when I try to remove this snap
sudo snap remove gnome-system-monitor

I get:

error: snap "gnome-system-monitor" has "auto-refresh" change in progress

Given the lack of control I have over snap behaviour, I want to remove as many snaps as I can. I am aware that I can install gnome-system-montor via apt, but snapd seems to be unable to upgrade it, and also won’t let me uninstall it.

So, the initial problem, of how to recover from a stuck “auto-refresh” still stands.

How can I remove a snap that is in this state?

Actual behaviour:

$ sudo snap refresh gnome-system-monitor:

error: cannot refresh "gnome-system-monitor": refreshing disabled snap "gnome-system-monitor" not
       supported

$ sudo snap enable gnome-system-monitor

error: snap "gnome-system-monitor" has "auto-refresh" change in progress

$ snap changes gnome-system-monitor

ID   Status  Spawn                   Ready                   Summary
311  Error   yesterday at 20:44 IST  yesterday at 20:53 IST  Refresh snap "gnome-system-monitor"
313  Error   yesterday at 20:55 IST  today at 19:43 IST      Refresh snap "gnome-system-monitor"
314  Abort   today at 19:48 IST      -                       Auto-refresh snap "gnome-system-monitor"

$ snap change 314

Status  Spawn               Ready               Summary
Undo    today at 19:48 IST  today at 19:48 IST  Ensure prerequisites for "gnome-system-monitor" are available
Undo    today at 19:48 IST  today at 19:48 IST  Download snap "gnome-system-monitor" (160) from channel "latest/stable/ubuntu-18.04"
Undo    today at 19:48 IST  today at 19:48 IST  Fetch and check assertions for snap "gnome-system-monitor" (160)
Undo    today at 19:48 IST  today at 19:48 IST  Mount snap "gnome-system-monitor" (160)
Undo    today at 19:48 IST  today at 19:48 IST  Run pre-refresh hook of "gnome-system-monitor" snap if present
Undo    today at 19:48 IST  today at 19:48 IST  Stop snap "gnome-system-monitor" services
Undo    today at 19:48 IST  today at 19:48 IST  Remove aliases for snap "gnome-system-monitor"
Undo    today at 19:48 IST  today at 19:48 IST  Make current revision for snap "gnome-system-monitor" unavailable
Abort   today at 19:48 IST  -                   Copy snap "gnome-system-monitor" data
Hold    today at 19:48 IST  today at 20:13 IST  Setup snap "gnome-system-monitor" (160) security profiles
Hold    today at 19:48 IST  today at 20:13 IST  Make snap "gnome-system-monitor" (160) available to the system
Hold    today at 19:48 IST  today at 20:13 IST  Automatically connect eligible plugs and slots of snap "gnome-system-monitor"
Hold    today at 19:48 IST  today at 20:13 IST  Set automatic aliases for snap "gnome-system-monitor"
Hold    today at 19:48 IST  today at 20:13 IST  Setup snap "gnome-system-monitor" aliases
Hold    today at 19:48 IST  today at 20:13 IST  Run post-refresh hook of "gnome-system-monitor" snap if present
Hold    today at 19:48 IST  today at 20:13 IST  Start snap "gnome-system-monitor" (160) services
Hold    today at 19:48 IST  today at 20:13 IST  Remove data for snap "gnome-system-monitor" (148)
Hold    today at 19:48 IST  today at 20:13 IST  Remove snap "gnome-system-monitor" (148) from the system
Hold    today at 19:48 IST  today at 20:13 IST  Clean up "gnome-system-monitor" (160) install
Hold    today at 19:48 IST  today at 20:13 IST  Run configure hook of "gnome-system-monitor" snap if present
Hold    today at 19:48 IST  today at 20:13 IST  Run health check of "gnome-system-monitor" snap
Hold    today at 19:48 IST  today at 20:13 IST  Consider re-refresh of "gnome-system-monitor"
Done    today at 19:48 IST  today at 20:13 IST  Ensure prerequisites for "gnome-3-38-2004" are available
Undone  today at 19:48 IST  today at 20:13 IST  Download snap "gnome-3-38-2004" (39) from channel "stable"
Done    today at 19:48 IST  today at 20:13 IST  Fetch and check assertions for snap "gnome-3-38-2004" (39)
Undone  today at 19:48 IST  today at 20:13 IST  Mount snap "gnome-3-38-2004" (39)
Undone  today at 19:48 IST  today at 20:13 IST  Copy snap "gnome-3-38-2004" data
Undone  today at 19:48 IST  today at 20:13 IST  Setup snap "gnome-3-38-2004" (39) security profiles
Undone  today at 19:48 IST  today at 20:13 IST  Make snap "gnome-3-38-2004" (39) available to the system
Undone  today at 19:48 IST  today at 20:13 IST  Automatically connect eligible plugs and slots of snap "gnome-3-38-2004"
Undone  today at 19:48 IST  today at 20:13 IST  Set automatic aliases for snap "gnome-3-38-2004"
Undone  today at 19:48 IST  today at 20:13 IST  Setup snap "gnome-3-38-2004" aliases
Undone  today at 19:48 IST  today at 20:13 IST  Run install hook of "gnome-3-38-2004" snap if present
Undone  today at 19:48 IST  today at 20:13 IST  Start snap "gnome-3-38-2004" (39) services
Undone  today at 19:48 IST  today at 20:13 IST  Run configure hook of "gnome-3-38-2004" snap if present
Undone  today at 19:48 IST  today at 20:13 IST  Run health check of "gnome-3-38-2004" snap

$ sudo snap revert gnome-system-monitor

error: cannot revert "gnome-system-monitor": cannot revert inactive snaps

As far as I can tell, this is basically a deadlock - I can’t go forward and can’t go backward.

Does anyone have any suggestions on how to break the deadlock?

Is your system low on disk space?

Is your system low on disk space?

$ df -h

Filesystem            Size  Used Avail Use% Mounted on
udev                   16G     0   16G   0% /dev
tmpfs                 3.2G  2.9M  3.2G   1% /run
/dev/nvme0n1p7        453G  299G  131G  70% /
tmpfs                  16G   22M   16G   1% /dev/shm
tmpfs                 5.0M  4.0K  5.0M   1% /run/lock
tmpfs                  16G     0   16G   0% /sys/fs/cgroup
/dev/loop6             56M   56M     0 100% /snap/core18/2074
/dev/loop7            100M  100M     0 100% /snap/core/11187
/dev/loop8            100M  100M     0 100% /snap/core/11316
/dev/loop10            56M   56M     0 100% /snap/core18/2066
/dev/loop11            62M   62M     0 100% /snap/core20/1026
/dev/loop13           2.3M  2.3M     0 100% /snap/gnome-system-monitor/148
/dev/loop14           141M  141M     0 100% /snap/gnome-3-26-1604/104
/dev/loop18           141M  141M     0 100% /snap/gnome-3-26-1604/102
/dev/loop20           219M  219M     0 100% /snap/gnome-3-34-1804/72
/dev/loop24           2.3M  2.3M     0 100% /snap/gnome-system-monitor/157
/dev/loop25           163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop26           162M  162M     0 100% /snap/gnome-3-28-1804/128
/dev/loop27            62M   62M     0 100% /snap/core20/975
/dev/loop29           219M  219M     0 100% /snap/gnome-3-34-1804/66
/dev/loop36            66M   66M     0 100% /snap/gtk-common-themes/1515
/dev/nvme0n1p1        646M   87M  560M  14% /boot/efi
tmpfs                 3.2G   28K  3.2G   1% /run/user/121
tmpfs                 3.2G   72K  3.2G   1% /run/user/1000
/dev/loop0            2.5M  2.5M     0 100% /snap/gnome-system-monitor/160

some /dev/loop /snap mounts have been omitted above, but I left in the ones that refered to gnome / core / gtk

TLDR: 131G available on root

what about these other nvme partitions where are they mounted ?

The other nvme partitions are for Windows / System recovery. They are not mounted or listed in /etc/fstab at all.

1 Like