Ubuntu Server should have refresh.retain=3 set by default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
Hi,
Is there a way to list the previous revisions of a snap in a specific channel and then allow the snap client to revert or install specific revisions?
I understand `snap revert` exists, but it only allows to revert to the last installed and that's it.
My use case is this, on an application unit using the ruby snap, it was automatically updated around 7 days ago. It wasn't until recently when we wanted to update the application where the latest ruby snap broke gem collection, see upstream bug[1]. But it wasn't known at the time so we thought to try the latest ruby from the latest channel (from 2.7/stable). So:
| snap refresh ruby --channel latest/stable
So now we want to revert:
| $ sudo snap revert ruby
| ruby reverted to 2.7.4
| $ sudo snap revert ruby
| error: cannot revert "ruby": no revision to revert to
What we actually want is to revert from 2.7.4 (231) in 2.7/stable to 2.7.4 (219) also in 2.7/stable.
The only way seems to be to find the correct URLs for both assertion file and snap itself, download both, and to use `snap ack <assertion file>` plus `snap install RjAgguCDAawLSJ3
summary: |
- Allow reverting to older revisions of a snap + Ubuntu Server should have refresh.retain=3 set by default |
Changed in snapd (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Low |
It is by design that you cannot revert to a snap that you do not already have installed on a system.
You can try using `snap list ruby --all` to get all currently installed revisions on your system (but note that only one revision can be "active" at a time), the revisions listed by this command are all the revisions that you can revert to.
You can increase the number of revisions that are kept around on a system to ensure that you are more likely to have the previous revision available by setting the refresh.retain system setting. I believe on Desktop/Server this setting defaults to 2, but on Ubuntu Core for example this setting defaults to 3.