Shipping Snap Revert to Ubuntu App Center

A feature that I worked on brings the snap revert out of the terminal and into Ubuntu's graphical App Center, shipped today with Ubuntu 26.04 LTS.

Ubuntu 26.04 LTS — Resolute Raccoon — is released today. It shipped with the latest version of App Center where I contributed a feature where you right-click an installed snap in App Center and pick Revert update. That action ships from a snapd.dart 0.7.4 primitive and an App Center Integration I worked on over the last few months. This post is the technical write-up.

What is the feature ?

Rolling a snap back to its previous local revision has lived at the snapd CLI for quite a while. This now brings it to App Center GUI.

snap revert firefox

I noticed ubuntu/app-center#1164 that was open since 2023 asking for the same thing in the GUI. If an automatic snap update breaks something, the user has no clue what snap is or how to drive it, and “open a terminal” is not an answer for the audience App Center is built for. So they uninstall, reinstall an older .deb if one exists, file a bug, or live with the regression. This feature directly address that and improves the end user experience. I am happy now millions people that use Ubuntu 26.04 LTS or updated versions of Ubuntu App Center get to benefit from this feature.

First half: A typed primitive in snapd.dart

canonical/snapd.dart#132 adds a SnapLocalRevision model and two client calls. The model is small but does one thing carefully - Snap revisions on the wire are not always int. Side-loaded snaps carry strings of the form xN, and some endpoints return num. The freezed-backed parser in this PR handles all three and rejects everything else, so the GUI layer never has to:

class SnapLocalRevision with _$SnapLocalRevision {
  const factory SnapLocalRevision({
    required String revision,        // "12", "x1", etc.
    required String version,
    required bool active,
  }) = _SnapLocalRevision;
}

The two client calls are then thin wrappers over snapd’s REST API:

  • getLocalRevisions(name)GET /v2/snaps?select=all&snaps=<name> and filters to local revisions only.
  • revertSnap(name)POST /v2/snaps/<name> with {"action": "revert"} and returns the change ID so callers can wait on it.

The PR also extends MockSnapdServer so unit tests cover the typed parsing edge cases (negative-style xN revisions, missing-field errors, request-body shape) without standing up a real snapd. The package landed as snapd 0.7.4 on pub.dev on 3 February 2026.

Second half: The App Center Integration

With the primitive in hand, ubuntu/app-center#1972 wires it through the UI:

  1. Gating. A hasPreviousRevision getter on the snap model decides whether the action even appears. There’s no point showing a “Revert update” button on a snap that has nowhere to go back to.
  2. Action. A new entry in the snap-detail dropdown menu, localised, that fires revertSnap and shows progress.
  3. Confirm dialog. The dialog shows the from → to version-and-revision pair when known, so the user is making an informed choice rather than picking a verb out of context.
  4. Post-revert UI. This was the most contentious bit in review. After revert, the snap-detail page now displays the actual installed version, not the channel version. The two are usually identical but diverge in exactly the case the user just exercised, and showing the channel version after a revert is what makes a user think the action did nothing.

The PR also carries widget tests, unit tests, and the localisation strings.

If you’ve upgraded to 26.04 LTS today and a snap update breaks something, the new path is: snap detail → dropdown → Revert update. Confirm. Done.