Article Summary: Teach the Fedora Silverblue/Kinoite user how to achieve “dnf swap” functionality, exemplified by replacing nano-default-editor with vim-default-editor
Article Description: Some users might need to achieve something similar to “dnf swap” with rpm-ostree, the one that will be demonstrated will be replacing nano-default-editor with vim-default-editor, but could also be shown with other things such as replacing wireplumber with pipewire-media-session.
All commands will be demonstrated on a Fedora Silverblue 35 VM.
How the article would be laid out:
- Introduction
- Quick explanation of how dnf swap works, possibly linking to an existing article. Saying that there’s equivalent functionality by how there’s the “–install” and “–uninstall” options on some of rpm-ostree’s commands, which allows doing those tasks along with the current transaction
- Demonstrate replacing nano-default-editor with vim-default-editor. Including showing output of “rpm-ostree override remove” on removing nano, “rpm-ostree install” on installing vim and “override remove” and “–install” combined to remove nano and install vim in the same transaction.
- Explain a secondary useful usecase where the user might want to run “rpm-ostree upgrade --install --uninstall ”, so they can uninstall and install packages in the same transaction. There are actually some reasons the user might run into them:
- The main one, just wanting to do remove and install stuff in the same transaction, probably while also doing the system updates, all at once.
- Previously on rpm-ostree it was possible that, if you installed a rpm which added a repository, rpm-ostree would keep using the version from the rpm instead of updating to a newer available version from the repository. This was most likely fixed already (ideally I should link to a related issue), but it should be useful to teach users on how to deal with such a case (which is to remove the “local package” and replace with the repo packages).
- Depending on the user, they might install rpms which do not add repositories and manage those updates manually, if the user tries to install the rpm of a newer version of the package, rpm-ostree will refuse it. So, ideally they should uninstall the old one and install the new one in the same transaction.
There are a few extra notes:
- Apparently replacing nano with vim causes some problems for me sometimes when updating because of dependencies, as far as I noticed it might be related to the state of the mirrors when they receive updates since it’s fixed a few hours later, I should probably mention it on the article.
- I am also not quite sure what package to use for the example of manually installed rpms conflicting with older one when installing a newer version, so I will most likely just create a simple rpm myself for that.