12

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
Merlijn Sebrechts
  • 7,215
  • 1
  • 42
  • 67
Natie
  • 223
  • 1
  • 2
  • 6

6 Answers6

19

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
  • 211
  • 3
  • 11
fswings
  • 291
  • 2
  • 3
4

You can change schedule for automatic updates

Managing updates | Snapcraft documentation

adasiko
  • 399
  • 2
  • 11
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.

Merlijn Sebrechts
  • 7,215
  • 1
  • 42
  • 67
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,388
  • 3
  • 15
  • 27
Rodolfo
  • 11
  • 1
-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
  • 69,223
  • 56
  • 216
  • 327