Can't install or refresh snaps on Arch Linux


#21

Perhaps that’s a case of buggy package purge in older version of the package. I think there was such a bug at some point, snap-mgmt --purge would remove stuff under /var/lib/snapd/ but state.json was left behind. That was a bunch of releases back though.

Would manually clearing device-serial in state.json unblock it?


#22

@mborzecki I think the easiest workaround would be:

snap ack “the generic model assertion”


#23

@_tim Can you try that?


#24

Yes, I’d like to, but I don’t know what “the generic model assertion” is…


#25

Try:

$ snap known --remote model model=generic-classic series=16 brand-id=generic > assertion
$ sudo snap ack assertion

#26

Ok, did that.
Now I get:

➜  ~ sudo snap refresh 
error: cannot perform the following tasks:
- Download snap "core" (5897) from channel "stable" (no device serial yet)

#27

Seems like there is no easy way out. Please see the output of snap changes to snap changes to check if Initialize device change appears.

If it does not then, try this:

$ systemctl stop snapd
$ sudo cat /var/lib/snapd/state.json | \
    jq 'delpaths([["data", "auth", "device"]])' > state.json-new
$ sudo cp state.json-new /var/lib/snapd/state.json
$ sudo systemctl start snapd

After a while you should see this:

$ snap changes
ID   Status  Spawn               Ready               Summary
19   Done    today at 18:29 CET  today at 18:29 CET  Initialize device

#28

That solved the problem for me! Thanks a lot!