ublue-os / main

OCI base images of Fedora with batteries included
https://universal-blue.org/images/main/
Apache License 2.0
487 stars 43 forks source link

Seems it's not possible to remove package added by Universal Blue #448

Closed Froggy232 closed 5 days ago

Froggy232 commented 9 months ago

Hi,

I have recently rebased from Fedora Silverblue 39 to Universal Blue 39 because I use a lot of package you add to the distro, so I don't have to layer them myself. Though, I would like to remove some package of the base image, through the "rpm-ostree override remove" command.

Everything work with package included in fedora silverblue, but with theses three packages : adw-gtk3-theme gnome-tweaks and libratbag-ratbagd, it doesn't work. I don't remember the exact error message, but the packages doesn't appear when I type "rpm-ostree status" and of course, they are present on the system after a reboot.

Does someone has an idea? Thanks you

bsherman commented 9 months ago

I'll add some context here.

Let's take an example on my own system where I use a custom image derived from silverblue-main. I include the ltrace package in this image.

Here I try to remove the package (previously added in the OCI image build) using the documented method of removing a pre-installed package.

$ rpm-ostree override remove ltrace
Inactive base removals:
  ltrace
Checking out tree af1ac61... done
Generating initramfs... done
Writing OSTree commit... done
Staging deployment... done
Freed: 95.0 MB (pkgcache branches: 0)
Use "rpm-ostree override reset" to undo overrides
Run "systemctl reboot" to start a reboot

Now I'll reboot, and then inspect the result:

$ rpm-ostree status -v  --booted
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
BootedDeployment:
● ostree-unverified-registry:ghcr.io/bsherman/silverblue-nvidia-custom:39 (index: 0)
                   Digest: sha256:e8b6e88d775c8caccd9c89758c5d63a106ce6ebc4e1d5899901be5d10ed11e64
                  Version: 39.20231214.0 (2023-12-14T16:14:18Z)
               BaseCommit: af1ac61e94addbb92a24ad995529bdea3ff432a3155b91702b3bdca960d2c19d
                   Commit: f32fa777c73e41d4029adcbdf27381207ba9f2322e129b016a5554fca24dc246
                   Staged: no
                StateRoot: fedora
     InactiveBaseRemovals: ltrace
                Initramfs: --force-add tpm2-tss

$ rpm -q ltrace
ltrace-0.7.91-48.fc39.x86_64

Note, the ltrace removal is listed as inactive and the package is still present.

You've found one of the few downsides I'm aware of with the current state of ostree native containers.

I don't know of a solution yet, or even a bug filed for this upstream.

Our approach to handling this in the Universal Blue project is to keep the *-main images as light as possible, since any user building on them won't be able to remove a previously added package.

castrojo commented 5 days ago

Bazzite has been shipping https://github.com/hhd-dev/rechunk and we just added this to the next set of Aurora/Bluefin builds.

This removes the removed packages from the layers and repacks them, so users can layer whatever they want on top without an error.