Article proposal: Achieve "dnf swap"-equivalent fucntionality with rpm-ostree

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.
1 Like

Hello @mateusrodcosta ,
It is a topic of interest for many who use Silverblue and variants of rpm-ostree based systems. As you are no doubt aware there are caveats to what you are attempting. I run rawhide Silverblue (currently pointing to F37) and there are instances where my preferred overlays cause me regression issues.
So for things like nano as the default editor, I chose not to uninstall it since it is of minimal footprint impact on space, overlayed vim-enhanced and vim, then just set the $EDITOR system variable to vim instead of nano for my user. I get no errors at updates in this case except lagging vim and vim-enhanced (see ref to rawhide above).
As for pipewire, I have had no issues after initial change over, so I can’t speak to the problems people seem to be experiencing regularly. In this case there are improvements happening continuously on pipewire and wireplumber and it is the future for media streaming, so I would be more interested in “how to do this function in pipewire and wireplumber that was so easy with pulse-audio”, than say replacing the new with the old way.
Just some of my thoughts on the topic,
+1 for the article in general principle though.

Hello, @mateusrodcosta

Thanks for your proposal. I’ve added card #90 for your article and assigned it to you.

Some tips on article creation are located here.

Thanks again.

FWIW, PasswordSafe is a manually-installed RPM that I have one my PC. If you want to use that as a demo on Silverblue, below is an example of how to upgrade it on Fedora Workstation for comparison.

[/home/gregory/pwsafe]$ ls
passwordsafe-fedora34-1.14-i386.rpm  passwordsafe-fedora34-1.14-i386.rpm.sig
[/home/gregory/pwsafe]$ gpg --verify passwordsafe-fedora34-1.14-i386.rpm.sig passwordsafe-fedora34-1.14-i386.rpm
gpg: Signature made Sun 10 Oct 2021 11:12:08 AM CDT
gpg:                using RSA key B131423D7F2F1BB9
gpg: Good signature from "Rony Shapiro (PasswordSafe signing key) <ronys@pwsafe.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: C887 6BE6 9A8E C641 4C8C  8729 B131 423D 7F2F 1BB9
[/home/gregory/pwsafe]$ sudo rpm -Uvh passwordsafe-fedora34-1.14-i386.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:passwordsafe-1.14-1              ################################# [ 50%]
Cleaning up / removing...
   2:passwordsafe-1.12-1              ################################# [100%]
[/home/gregory/pwsafe]$