Why dnf autoremove wants to remove used dependency?

~ > dnf history info 7
Transaction ID : 7
Begin time     : 2026-08-17 19:05:22
Begin rpmdb    : 17e862d767ad57a849e5cbb84b7a57d98957de7cb97de674cf28f4edd8b27757
End time       : 2026-08-17 19:05:22
End rpmdb      : aa44071e55990b85f7d6fa8881566c438fa8cd142ebaaf540f8fe7c921dbbec7
User           : 1000 Aleksandr David <david>
Status         : Ok
Releasever     : 44
Description    : dnf install @multimedia --setopt=install_weak_deps=False --exclude=PackageKit-gstreamer-plugin -y
Comment        : 
Packages altered:
  Action  Package                                                 Reason     Repository
  Install gstreamer1-plugins-bad-freeworld-1:1.28.6-1.fc44.x86_64 Group      rpmfusion-free-updates
  Install libde265-0:1.0.18-1.fc44.x86_64                         Dependency rpmfusion-free
  Install svt-hevc-libs-0:1.5.1-10.fc44.x86_64                    Dependency rpmfusion-free
  Install gstreamer1-plugins-ugly-1:1.28.6-1.fc44.x86_64          Group      rpmfusion-free-updates
  Install libheif-freeworld-0:1.21.2-3.fc44.x86_64                Group      rpmfusion-free
  Install pipewire-codec-aptx-0:1.6.7-1.fc44.x86_64               Dependency rpmfusion-free-updates
  Install libfreeaptx-0:0.2.2-3.fc44.x86_64                       Dependency rpmfusion-free
Groups altered:
  Action        Package    Reason Repository
  Reason Change multimedia User   fedora

~ > sudo dnf autoremove
Package                              Arch     Version                               Repository                      Size
Removing:
 libfreeaptx                         x86_64   0:0.2.2-3.fc44                        rpmfusion-free              53.1 KiB
 pipewire-codec-aptx                 x86_64   0:1.6.7-1.fc44                        rpmfusion-free-updates      52.9 KiB

Transaction Summary:
 Removing:           2 packages

After this operation, 106 KiB will be freed (install 0 B, remove 106 KiB).
Is this ok [y/N]: n
Operation aborted by the user.
~ >

I’ve been troubleshooting of why my screen is being timeout and start artifacting when using OBS with FFmpeg VAAPI H.264 encoder; turns out it was because I ran sudo dnf autoremove before and I didn’t pay enough attention that it removed two dependencies that causes this.

These dependencies was installed through sudo dnf install @multimedia --setopt=install_weak_deps=False --exclude=PackageKit-gstreamer-plugin from rpm fusion multimedia and was removed cuz I ran sudo dnf autoremove before.

So why dnf autoremove tried to remove used dependency? And how do I lock it so it won’t remove again when I run it?

The only thing I can find is that nothing requires pipewire-codec-aptx. If I run dnf leaves |grep pipewire-codec-aptx I get

- pipewire-codec-aptx-0:1.6.7-1.fc44.x86_64

Yeah but if I remove it, I can’t record on OBS with FFmpeg VAAPI H.264 encoder option. Idk why. Flathub version works without it though.

You can sudo dnf install pipewire-codec-aptx after it has been autoremoved, and it will then be marked “user installed” and therefore won’t be autoremoved again.