Why does dnf want to remove 441 packages when removing openh264 installed from fedora-cisco-openh264 repository?

[miner@hostx ~]$ sudo dnf remove openh264
(…)
Transaction Summary:
 Removing:         441 packages

After this operation, 3 GiB will be freed (install 0 B, remove 3 GiB).

… it’s basically saying that all those packages depend on openh264 … so, if you remove openh264, may as well remove those that depend on it as well …

If you don’t want to use openh264 then you have to swap it with noopenh264 with dnf swap and then lock the package so that it does not get replaced again with dnf version lock or something similar.

2 Likes

Not all of them depend on OpenH264.

When you remove a package, the dependency resolver has to do two things:

  1. walk up the dependency tree and remove all packages whose dependencies are no longer fulfilled.
  2. remove all child packages that were automatically installed as a dependency of the removed package(s).

You can find which (installed) packages have a specific dependency with dnf repoquery --whatrequires:

~ ❯ dnf repoquery --installed --whatrequires openh264
ffmpeg-libs-0:7.1.1-3.fc41.x86_64
freerdp-libs-2:3.12.0-1.fc41.x86_64
freerdp2-libs-0:2.11.7-5.fc41.x86_64
gstreamer1-plugin-openh264-0:1.24.11-1.fc41.x86_64
libheif-0:1.19.7-1.fc41.x86_64
mozilla-openh264-0:2.4.1-2.fc41.x86_64
qt6-qtwebengine-0:6.8.2-4.fc41.x86_64

So, if I tried to remove openh264 from my (KDE, not Fedora Workstation) system, as a first step the seven packages that directly depend on openh264 would need to be removed as their openh264 dependency is no longer fulfilled.

Next, all packages that depend on one of these seven would have have to be removed. For example, for ffmpeg-libs on my system, the following packages depend on that and would need to be removed:

~ ❯ dnf repoquery --installed --whatrequires ffmpeg-libs
ffmpeg-0:7.1.1-3.fc41.x86_64
ffmpegthumbs-0:24.12.3-1.fc41.x86_64
gstreamer1-plugin-libav-0:1.24.11-1.fc41.x86_64
kf6-kfilemetadata-0:6.12.0-1.fc41.x86_64
kpipewire-0:6.3.3-1.fc41.x86_64
libavdevice-0:7.1.1-3.fc41.x86_64
libchromaprint-0:1.5.1-24.fc41.x86_64
libheif-freeworld-0:1.19.7-1.fc41.x86_64
qt6-qtmultimedia-0:6.8.2-1.fc41.x86_64
qt6-qtwebengine-0:6.8.2-4.fc41.x86_64

This continues until the resolver has reached a stable configuration or an error. On your system, this means removing an additional 440 packages when removing openh264.

1 Like

Thanks for all the information.
The problem with the list was that there were packages there having nothing to do with h264 like for example openvpn or kate (KDE text editor) and many others which intuitively should not be connected with openh264 neither directly nor indirectly in the dependency tree. That seemed like some problem with the package database.

Nothing directly depends openh264, everything in the repo’s is built using noopenh264

$ dnf repoquery --whatrequires noopenh264
Updating and loading repositories:
Repositories loaded.
chromium-0:134.0.6998.165-1.fc42.x86_64
ffmpeg-libs-0:7.1.1-3.fc42.x86_64
freerdp-libs-2:3.12.0-1.fc42.i686
freerdp-libs-2:3.12.0-1.fc42.x86_64
freerdp2-libs-0:2.11.7-7.fc42.i686
freerdp2-libs-0:2.11.7-7.fc42.x86_64
gstreamer1-plugin-openh264-0:1.26.0-1.fc42.i686
gstreamer1-plugin-openh264-0:1.26.0-1.fc42.x86_64
libavcodec-free-0:7.1.1-3.fc42.i686
libavcodec-free-0:7.1.1-3.fc42.x86_64
libavcodec-freeworld-0:7.1.1-3.fc42.x86_64
libheif-0:1.19.7-1.fc42.i686
libheif-0:1.19.7-1.fc42.x86_64
mozilla-openh264-0:2.4.1-2.fc42.x86_64
noopenh264-devel-0:2.5.0-2.fc42.i686
noopenh264-devel-0:2.5.0-2.fc42.x86_64
openh264-devel-0:2.4.1-2.fc42.x86_64
qt6-qtwebengine-0:6.8.2-4.fc42.x86_64
telegram-desktop-0:5.12.3-1.fc42.x86_64
telegram-desktop-0:5.13.1-1.fc42.x86_64
xpra-codecs-freeworld-0:5.0.10-3.fc42.x86_64
xrdp-1:0.10.2-11.fc42.i686
xrdp-1:0.10.2-11.fc42.x86_64

To switch is easy

sudo dnf swap *\openh264\*  noopenh264

And to prevent it being installed again

sudo dnf config-manager setopt  fedora-cisco-openh264.enabled=0
1 Like

Thanks for sharing sudo dnf swap \*openh264\* noopenh264 as it looks like the stars are essential here.

No stars (notice Problem note and openh264 replacing itself?!):

sudo dnf swap openh264 noopenh264    
Updating and loading repositories:
Repositories loaded.
Problem: cannot install the best candidate for the job
  - conflicting requests

Package                        Arch    Version                         Repository                   Size
Reinstalling:
 openh264                      x86_64  2.4.1-2.fc41                    fedora-cisco-openh264     1.1 MiB
   replacing openh264          x86_64  2.4.1-2.fc41                    <unknown>                 1.1 MiB

Transaction Summary:
 Reinstalling:       1 package
 Replacing:          1 package

Total size of inbound packages is 420 KiB. Need to download 420 KiB.
After this operation, 0 B extra will be used (install 1 MiB, remove 1 MiB).
Is this ok [y/N]:

With stars (looks OK):

sudo dnf swap \*openh264\* noopenh264
Updating and loading repositories:
Repositories loaded.
Problem: cannot install the best candidate for the job
  - conflicting requests

Package                           Arch      Version                           Repository            Size
Removing:
 gstreamer1-plugin-openh264       x86_64    1.24.11-1.fc41                    updates           70.9 KiB
 mozilla-openh264                 x86_64    2.4.1-2.fc41                      <unknown>          1.1 MiB
 openh264                         x86_64    2.4.1-2.fc41                      <unknown>          1.1 MiB
Installing:
 noopenh264                       x86_64    0.1.0~openh264_2.4.1-2.fc41       fedora            43.0 KiB

Transaction Summary:
 Installing:         1 package
 Removing:           3 packages

Total size of inbound packages is 22 KiB. Need to download 22 KiB.
After this operation, 2 MiB will be freed (install 43 KiB, remove 2 MiB).
Is this ok [y/N]:

Don’t forget to disable cisco repo after removing their packages

sudo dnf config-manager setopt  fedora-cisco-openh264.enabled=0
1 Like