How to pin a previous/the current deployment with rpm-ostree?

I know there was a way to pin a deployment in rpm-ostree, so when updating (and especially when upgrading to Fedora 34 e.g.), you could keep the old system and do not have iot auto-deleted, so you can always revert it.

Because Fedora Silverblue by default auto-deletes after the first 3 bots or so…

How can I do it?

3 Likes

Ah, I just remembered and if I had read the Silverblue FAQ properly it is alos stated there.

Don’t use rpm-ostree, but ostree!

The command is e.g. (to pin the current deployment):

$ sudo ostree admin pin 0

I always get confused, because I can view the system status with rpm-ostree status [-v] and upgrade etc., but need to do this “low-level” stuff with that other command…

1 Like

What’s the proper procedure to revert back to the pinned version?

I know you can select it from the GRUB menu, but is there a command to make it permanent, or automatically select it for the next reboot?

Hello @guiltydoggy ,
You would use ostree for that. The command should be something like sudo ostree reset 2 I think since the default deploy is 0 and the rollback is 1 so the pinned is 2, or so I believe that is the way ostree handles deploys. You could also just boot your pinned deploy and upgrade from there to get a new deploy with upgrades based on your pinned deployment. The previous rollback gets deleted, and your default deployment gets relabeled as rollback, etc… The pinned one stays pinned until you specifically unpin it.

3 Likes