How to delete image deployment after unpinning?

I have had pinned image deployment, because of having issues. Now latest image is working fine for me and I have unpinned the image:
sudo ostree admin pin --unpin 2

Then I have checked current state with rpm-ostree status and I get:

 rpm-ostree status
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:stable
                   Digest: sha256:308f2addc0874bb901680a8bf8b8a817cf9e102ac3e6d40dac7a0955f42ad1df
                  Version: 41.20250209.1 (2025-02-09T06:02:01Z)

  ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:stable
                   Digest: sha256:12fefae335b0ba23ca0380a589cbf1de8ca1042e2fe7782829f1e84c892bbdd4
                  Version: 41.20250202.1 (2025-02-02T05:59:53Z)

  ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:stable
                   Digest: sha256:59119e20585df337400bf3621167a242007c48654bb5bc2070189f6952306381
                  Version: 41.20250119.1 (2025-01-19T06:00:40Z)

Now I would like to delete this image deployment. I tried with:
rpm-ostree cleanup -m 59119e20585df337400bf3621167a242007c48654bb5bc2070189f6952306381 then I have reboot Linux and rpm-ostree status still shows all three image deployments.

How to delete last image deployment?

Hey,

You can use rpm-ostree cleanup --remove 2 to do that.

The -m option deletes cached RPM repository metadata only.

It looks like that command deletes all of the rollback image deployments, not just last one. :slight_smile:

rpm-ostree status
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:stable
                   Digest: sha256:308f2addc0874bb901680a8bf8b8a817cf9e102ac3e6d40dac7a0955f42ad1df
                  Version: 41.20250209.1 (2025-02-09T06:02:01Z)

In this case it is no harm, because my latest image is bootable.

Oopsie poopens! Me right now

1 Like
  1. rpm-ostree status, note the index number of the target deployment.

  2. sudo ostree admin undeploy n, with n being the index number of the target deployment.

2 Likes

I have had the same issue. Just to confirm @mel226 solution works fine. Thanks.

A bit of an oopsie on my part actually. I should have said rpm-ostree status -v. But glad you were able to find a working method.

❯ rpm-ostree status -v
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 5min ago
Deployments:
● ostree-image-signed:docker://ghcr.io/askpng/solarpowered-ex:br-dnf-42 (index: 0)
                   Digest: sha256:2b256cf88b1016d78c17e3870af8b32c747e580dd20ed9bcc25c71ee1afe601b
                  Version: 42.250321 (2025-03-21T13:30:25Z)
               BaseCommit: de3db9681f7c90b7bbf7b88ee4668b6f993c18d8cbe79a32e167f3633b607e36
                   Commit: d426e48bb4a52c8ff2ef9676d2096c135a73ddf7c805af4959ef2ec290cd4cce
                           ├─ fedora (1970-01-01T00:00:00Z)
                           └─ updates (1970-01-01T00:00:00Z)
                   Staged: no
                StateRoot: default
                Initramfs: regenerate

  ostree-image-signed:docker://ghcr.io/askpng/solarpowered-ex:br-42-42 (index: 1)
                   Digest: sha256:704f2ceeaab0cfbc39e2624ce941ae7be14a63127f019bccc34ab503c40d0138
                  Version: 42.250321 (2025-03-21T10:01:20Z)
               BaseCommit: 5d2d860165fc426bb7e7f6e4037e83e5cafeca1dff6c07e8ce6e9d12e7303a79
                   Commit: 2e9b613c3d21d0c65896e1dd4e7a735659d157576af92e16fc6245ed186597fd
                           ├─ fedora (1970-01-01T00:00:00Z)
                           └─ updates (1970-01-01T00:00:00Z)
                StateRoot: default
                Initramfs: regenerate

  ostree-image-signed:docker://ghcr.io/askpng/solarpowered-ex:latest (index: 2)
                   Digest: sha256:4b1e332c64cc5a26ddf6ce54037f9900522442ebfeefc1ecfc924104b58bc823
                  Version: 41.250321 (2025-03-21T03:09:00Z)
               BaseCommit: 637d4119b1fd16f09ca1e0069330a0e6f63145c682662f148c2ea1a23c0e1d90
                   Commit: 3e802c8056e6528a0c61f8b839220146b3a90caea603acc45a785e29e88e4555
                           ├─ fedora (1970-01-01T00:00:00Z)
                           └─ updates (1970-01-01T00:00:00Z)
                StateRoot: default
                Initramfs: regenerate
                   Pinned: yes

Note the (index: n). So if I were to remove the Commit: 2e9b613c3d21d0c65896e1dd4e7a735659d157576af92e16fc6245ed186597fd image, I would run sudo ostree admin undeploy 1.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.