Running dnf autoremove, should I be removing these packages?

, ,

Hi,

I just ran dnf autoremove to see if there are unneeded dependencies on my system which could be removed. This is the output:

$ sudo dnf autoremove
Package                                Arch       Version                                Repository                Size
Removing:                                                                                                              
 amd-ucode-firmware                    noarch     20231111-1.fc39                        updates              236.2 KiB
 dbus-glib                             x86_64     0.112-6.fc39                           fedora               370.4 KiB

Transaction Summary:
 Removing:          2 packages

After this operation 607 KiB will be freed (install 0 B, remove 607 KiB).
Is this ok [Y/n]: n  
Operation aborted by the user.

I am not sure if I should be removing these.

I am on Fedora 39 (upfraded from 38) and the machine has a AMD processor.

Are you short on disk space? You will just save 607 KB ! If you remove it, it probably just will install on the next update.

Description : Microcode updates for AMD CPUs, ARM SEV amd TEE.

1 Like

I just have this inexplicable urge to remove stuff :sweat_smile:

Sure.

Is there any way I can mark them not to be removed next time there is a legitimate reason to remove unneeded dependencies?

Is this correct: sudo dnf mark install amd-ucode-firmware for example?

amd-ucode-firmware is a dependency of linux-firmware. You should have linux-firmware installed on any bare metal installation; fix that and dnf shouldn’t want to remove it anymore.

dbus-glib is an obsolescent library. It can safely be removed if nothing uses it. In the default Workstation package set, it seems to be pulled in by firefox and thermald.

3 Likes

It’s just a weak dependency. If, for some reason, autoremove wants to remove it (it doesn’t, in my case), I’d suggest explicitly marking it as wanted with sudo dnf mark install amd-ucode-firmware.

2 Likes

Tanks, it is nice to learn every day something new :blush:

2 Likes

I have done this already.

Thanks for the reply and confirmation!

1 Like

I have run:

$ rpm -q --whatrequires dbus-glib
no package requires dbus-glib

So I’ll be removing this one. Thank you!

1 Like

It should not be the case in Fedora 39 on x86_64:
Tree - rpms/linux-firmware - src.fedoraproject.org
Something seems broken here.

2 Likes

It’s not quite that simple:

$ rpm -q --provides dbus-glib
dbus-glib = 0.112-6.fc39
dbus-glib(x86-64) = 0.112-6.fc39
libdbus-glib-1.so.2()(64bit)

A package that uses a shared library will usually require the library soname directly, i.e. libdbus-glib-1.so.2()(64bit). The dnf equivalent resolves that automatically by default:

dnf repoquery --installed --whatrequires dbus-glib

Of course, the result would probably have been the same in your case. dnf wouldn’t be offering to remove it otherwise.

1 Like

Thanks @chrisawi for the explanation! I appreciate it.

I also have the same problem about the amd-ucode-firmware. I probably dnf autoremove’d it in the past. What’s the correct thing to do? Why does dnf want to autoremove it?

Currently, I see amd-ucode-firmware is a mandatory package of Fedora Workstation product core(@workstation-product), which is a mandatory group of Fedora Workstation. In theory it shouldn’t be autoremoved?

dnf commands
$ sudo dnf group list --installed
Installed Environment Groups:
   Fedora Workstation
Installed Groups:
   Container Management
$ dnf group info "Fedora Workstation"
Environment Group: Fedora Workstation
 Description: Fedora Workstation is a user friendly desktop system for laptops and PCs.
 Mandatory Groups:
   Common NetworkManager Submodules
   Container Management
   Core
   Fedora Workstation product core
   Firefox Web Browser
   Fonts
   GNOME
   Guest Desktop Agents
   Hardware Support
   LibreOffice
   Multimedia
   Printing Support
   base-x
$ dnf group info "Fedora Workstation product core"
Group: Fedora Workstation product core
 Description: Packages mandatory for the workstation product.
 Mandatory Packages:
   amd-gpu-firmware
   amd-ucode-firmware
   dnf
   intel-gpu-firmware
   linux-firmware
   microcode_ctl
   nvidia-gpu-firmware
   sudo
   systemd-udev
   tar
   xorg-x11-drv-libinput
...
$ dnf repoquery --groupmember amd-ucode-firmware
amd-ucode-firmware-20231111-1.fc39.noarch
  @standard
  @workstation-product

Anyway, is there a way to restore just this one package?
I have removed some GUI packages from the product core, if I dnf group install "Fedora Workstation product core" they (and the giant list of dependencies) all want to come back.
Is manually installing and changing mark the right way to do this? I still don’t quite understand how dnf can change package to group mark without knowing which group it belongs to.

sudo dnf install amd-ucode-firmware
sudo dnf mark group amd-ucode-firmware

EDIT: Don’t use this one, check below.

p.s. What is the friendly name of @standard?

I think I found what the case was for me[1], not sure about OP though. My install started from F39 Beta.

Yes there is! Not sure why this works though XD
Do we need to run dnf group upgrade from time to time now?

$ sudo dnf group upgrade "Fedora Workstation"
Installing group/module packages:
 amd-ucode-firmware

  1. https://src.fedoraproject.org/rpms/linux-firmware/c/50de9939e0bb50f7b0ef77bcf4ecdd517ae15da1?branch=rawhide ↩︎

Do you have linux-firmware installed? As discussed above, it should have a hard dependency on amd-ucode-firmware in F39, changing to Recommends in F40.

Yes I have, but dnf upgrade never prompted me for the install of amd-ucode-firmware.

2251053 – amd-ucode-firmware subpackage is not pulled as a dependency on x86_64

2 Likes