18

I installed my dev tools via snap, big updates came out for most of them recently (Jetbrains), biggest being Android studio. But no matter what I do I can't remove or update any of my applications installed via snap.

When I try to remove the snap, I get the following error message:

error: snap "android-studio" has "auto-refresh" change in progress

I tried disabling "auto-refresh" with a bunch of other recommendations from other questions and threads.

I would like to specify when I want to update. Is there any way to update snaps like regular APT packages?

When I run "snap refresh", I get the following error:

error: change finished in status "Hold" with no error message
Natie
  • 283

9 Answers9

28

This was the top search item for the topic as I was trying to remove a snap whilst it was "auto-refreshing". The better answer in that it allows you to stop the refresh and take action is covered in Ask Ubuntu.

In effect:

# Check for snap changes
sudo snap changes

This will list something like

ID Status Spawn Ready Summary <number> Doing today at 10:58 CEST - Auto-refresh snap <snap_program>

Note the ID for the refresh and abort it

sudo snap abort <number>

You must check changes until it has been actioned

sudo snap changes

This will now list something like

ID Status Spawn Ready Summary <number> Error today at 10:58 CEST - Auto-refresh snap <snap_program>

The take remedial action, in my case remove

sudo snap remove <snap_program>

Tested with microk8s on Ubuntu 18.04 and chromium on Ubuntu 20.04.

hb0
  • 251
fswings
  • 381
4

You can change schedule for automatic updates

Managing updates | Snapcraft documentation

adasiko
  • 409
3

There is currently no way to forcibly remove a snap when a refresh is in process.

Once the refresh is finished, you can speed up the snap removal by skipping the backup using --purge. Normally, when a snap is removed, the data of that snap is backed up. This backup can take some time.

snap remove --purge android-studio 

Note that this command will remove all data from that snap.

2

Check snap changes then note down the ID

sudo snap changes                                          10 ↵  
ID   Status  Spawn                   Ready                   Summary
746  Done    yesterday at 01:28 IST  yesterday at 01:30 IST  Pre-download "android-studio" for auto-refresh
747  Done    yesterday at 12:24 IST  yesterday at 12:26 IST  Pre-download "android-studio" for auto-refresh
748  Done    yesterday at 22:29 IST  today at 07:25 IST      Pre-download "android-studio" for auto-refresh
749  Done    today at 07:41 IST      today at 07:42 IST      Pre-download "android-studio" for auto-refresh
750  Error   today at 09:57 IST      today at 09:59 IST      Auto-refresh snap "android-studio"
751  Doing   today at 10:00 IST      -                       Auto-refresh snap "android-studio"

Then run abort

sudo snap abort 751

Wait for a few min then refresh/remove manually

 sudo snap refresh android-studio
Arul
  • 141
1

Downgrading to the previous version (removing changes done by the update) first will solve this problem, after which allow you to also delete the snap package with no errors:

[rodolfo@fedora ~]$ sudo snap revert discord 
discord reverted to 0.0.13

[rodolfo@fedora ~]$ sudo snap remove discord discord removed

Pizza
  • 1,512
Rodolfo
  • 11
0

Killing the process doesn't work. You can try hold command.

sudo snap refresh --hold=2h chromium
sudo snap refresh chromium 
0

TL;DR

restart snap service if you are using systemd

sudo systemd restart snapd

Explanation

So, fswing's answer is correct. I followed all the steps to abort auto-refresh but somehow, snap is always stuck and cannot proceed with enabling my nvim installation.

So, here is how I'm fixing it.

First, try to abort auto-refresh

# Check for snap changes
sudo snap changes

This will list something like

ID Status Spawn Ready Summary <number> Doing today at 10:58 CEST - Auto-refresh snap <snap_program>

Note the ID for the refresh and abort it

sudo snap abort <number>

But somehow, I cannot enable nvim / manually start refresh. I figured out what if I try to restart snapd service instead? So I go with:

systemd status snapd

To check current active snapd service. Running this command will return something like:

● snapd.service - Snap Daemon
     Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; preset: enabled)
     Active: active (running) since Tue 2020-01-01 23:33:30 ; 1 week 5 days ago
TriggeredBy: ● snapd.socket
   Main PID: 18828317 (snapd)
      Tasks: 22 (limit: 37977)
     Memory: 3.7G (peak: 1.8G swap: 2.1M swap peak: 2.1M)
        CPU: 3min 9.356s
     CGroup: /system.slice/snapd.service
             └─18828317 /usr/lib/snapd/snapd

Then restart with:

sudo systemd restart snapd
-3

You can add the parameter "now" to the end of your command, it will ignore the "auto-refresh".

example:

sudo snap remove android-studio now
-4

The way it worked for me was the parameter force instead of now

sudo snap remove android-studio force
Zanna
  • 72,312