Problem with *nvidia* removing

I recently installed Fedora 37 and had some issues with nvidia drivers. And as a step to solve it I wanted to delete it. But when I try

dnf remove *nvidia*

I get:
Problem: The operation would result in removing the following protected packages: kernel-core

I searched for some approaches to solve it on the Internet and i already tried:

  1. to add “–skip-broken” parameter
  2. to set install_limit=0 in /etc/dnf/dnf.conf. (it was recommended here)

I suppose something happened when I was installing nvidia drivers and my computer shut down. I am new to linux so don’t know much enough to solve this problem.

P.S. I read that my rpm -qa | grep ^kernel can help:

kernel-core-6.0.7-301.fc37.x86_64
kernel-modules-6.0.7-301.fc37.x86_64
kernel-6.0.7-301.fc37.x86_64
kernel-modules-extra-6.0.7-301.fc37.x86_64
kernel-devel-6.0.7-301.fc37.x86_64
kernel-srpm-macros-1.0-15.fc37.noarch
kernel-headers-6.1.5-200.fc37.x86_64
kernel-core-6.1.11-200.fc37.x86_64
kernel-modules-6.1.11-200.fc37.x86_64
kernel-6.1.11-200.fc37.x86_64
kernel-devel-6.1.11-200.fc37.x86_64
kernel-devel-matched-6.1.11-200.fc37.x86_64
kernel-modules-extra-6.1.11-200.fc37.x86_64

If you installed nvidia from rpmfusion this should remove it
sudo dnf remove xorg-x11-drv-nvidia\*
If you want to try and reinstall it
sudo dnf install akmod-nvidia
that should work
removing kernel-core should not hurt anything but if you need it just reinstall it
sudo install kernel-core

Thank you! I had some terrible problems with the drivers so after booting system shut down every time but sudo dnf install akmod-nvidia helped. Thanks again!

I use nvidia constantly. The command sudo dnf install akmod-nvidia pulls in all the dependencies required to build the modules after the install completes, and is the recommended way to install the nvidia drivers. If you need cuda that is installed with sudo dnf install xorg-x11-drv-nvidia-cuda as well