No package called cuda, but cannot remove cuda anyway (would remove protected package)

Why the first command tells me that no package with that name is installed, while the second command would not allow me to proceed?

[raffaele@fedora ~]$ sudo dnf list --installed | grep cuda
[raffaele@fedora ~]$ sudo dnf remove *cuda*
Error: 
 Problem: The operation would result in removing the following protected packages: gnome-shell
(try to add '--skip-broken' to skip uninstallable packages)
1 Like

Many dnf subcommands (including remove) take a <package-spec> parameter that selects a package for the operation. The argument is matched against package NEVRAs, provides and file provides. dnf remove *cuda* tries to remove libicu package because:

$ rpm -ql libicu | grep cuda
/usr/lib64/libicudata.so.69
/usr/lib64/libicudata.so.69.1

And the dependency chain results with trying to remove gnome-shell, hence the error message.

4 Likes

Uhm thanks.

But why that libicu doesn’t show up in sudo dnf list --installed | grep cuda?

And how did you guess that that command would result in the removal of libicu?

Why also sudo dnf remove *nvidia* wants to remove kernel-core?

$ sudo dnf remove *nvidia*
Error: 
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages)
1 Like

Because dnf list only lists package names, not their provides and file provides.

I don’t have gnome-shell installed. I tried to execute dnf remove *cuda* command and it wanted to remove libicu and many other packages which depend on libicu, but none of these packages were a protected package like gnome-shell so I could see the the packages which will be removed if I would proceed.

$ rpm -q --requires kernel-core
/bin/sh
/bin/sh
/bin/sh
/usr/bin/kernel-install
coreutils
dracut >= 027
linux-firmware >= 20150904-56.git6ebf5d57
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
systemd >= 200
systemd >= 203-2
/bin/sh
/bin/sh
/bin/sh
/usr/bin/kernel-install
coreutils
dracut >= 027
linux-firmware >= 20150904-56.git6ebf5d57
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
systemd >= 200
systemd >= 203-2

From that list, I listed linux-firmware package’s provides because it looks like the most obvious one:

$ rpm -ql linux-firmware | grep nvidia
/usr/lib/firmware/nvidia
...
many results
...

I’m not sure, but maybe the packages not use dnf from RPMFussion but from NVIDIA. Try with ls /bin | grep -i nvidia. If from the list result you find nvidia-uninstall then you should use that when want to uninstall nvidia driver (from tty console/non-graphical session).

Hera on my case with NVIDIA 340xx patched.

[rizal@fedora ~]$ sudo dnf remove *nvidia*
Error: 
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages)

[rizal@fedora nvidia-5.16.x]$ ls /bin | grep -i nvidia
nvidia-bug-report.sh
nvidia-cuda-mps-control
nvidia-cuda-mps-server
nvidia-debugdump
nvidia-installer
nvidia-modprobe
nvidia-persistenced
nvidia-settings
nvidia-smi
nvidia-uninstall
nvidia-xconfig

Thanks.

Strange there is no definitive way to reconstruct the dependencies chain.

Uhm there are NVIDIA binaries indeed but no uninstall:

$ ls /bin | grep -i nvidia
nvidia-bug-report.sh
nvidia-cuda-mps-control
nvidia-cuda-mps-server
nvidia-debugdump
nvidia-modprobe
nvidia-persistenced
nvidia-settings
nvidia-smi
nvidia-xconfig

Uhm ok sudo dnf remove nvidia* got rid of them

If you install the nvidia driver from rpmfusion you avoid those strange behaviors. None of the nvidia packages from rpmfusion are linked to any part of the kernel or gnome except the kernel-devel package which is not a protected package.

1 Like

But tensorflow requires a specific version of CUDA, 11.2.

Will tensorflow work with the packages installed from rpmfusion?

The cuda version installed from rpmfusion on my system is 11.6
The package is xorg-x11-drv-nvidia-cuda

Eh tensorflow requires 11.2, I don’t think it will work with 11.6, it would give not found libraries error

For completeness, here are the RPM Fusion links:

https://rpmfusion.org/Howto/CUDA

It says: " NVIDIA official repositories: These repositories contain versions of CUDA that are parallel installables along with another version."

To me that indicates that you can install different versions of CUDA in parallel but using the Nvidia drivers from RPM Fusion instead of the binary ones that Nvidia provide.

https://rpmfusion.org/Howto/NVIDIA

1 Like

Most packages require a minimum version of dependencies and usually work with the later versions as well.

I don’t think TensorFlow is among those. Please see here