HowTo: reinstall packages that were removed during image build

making another controversial howto

Due to issues in the whole rpm-ostree-image-building process, if a project decides to use an image and remove packages from it, the end user can’t add these packages back.

The issue can be found here.

But what if you disagree with what the people did in this downstream process? All love to you, your images are great, but this issue makes them a no-go for me.

Luckily @qoijjj found a workaround: You just need to install an RPM package that requires that removed package, and the package will be installed along with it!

Now you can search for suitable packages, but in all cases you will add a random package you don’t actually need. But you can build your own RPM, which can be empty, it only needs to specify these lines:

Requires:       firefox
Requires:       firefox-langpacks

(in the example of firefox)

Building RPMs is kinda strange, but I managed to script the process and it is near instant. The script can be ran from any directory, will create the needed directories, write the spec file and build the RPM. It requires rpmbuild to be installed, which you might want to do in a toolbox/distrobox.

In my repo you can find the script and an empty RPM installing firefox back

Then you can install it using

rpm-ostree install /path/to/my.rpm

(You can drag-drop the file into most terminal apps)

The result looks like this:

test@bluefin ~> 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:6ce166a9239812b9af2b73db75fda501619b6317ec34c37705c79c4aab414980
                  Version: 41.20250223.1 (2025-02-23T06:02:32Z)
            LocalPackages: require-firefox-1.0-1.fc41.noarch

It does not shown as layered, so I wonder how it will impact update performance

What error do you get?

“The package is already requested”

Do you have a link to your build logs?

I did it locally, on my machine.

But I think I already tried it with blue-build but always got empty errors

If you rechunk the images (like we do on bazzite/bluefin) that kind of resets the board and you should be able to rip out what you need.

Bluefin is mostly packaged now so it’s probably easier to just derive from that. It’s rechunked already so you can add/remove. Then just remove the ublue/bluefin packages you don’t want to make it more vanilla: packages/packages at main · ublue-os/packages · GitHub

1 Like

Interesting! For single user systems this makes not that much sense, but it is good for larger deployments