Solving Kernel Compilation “It’s not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers” in Red Hat GNU/Linux
Hi! This Tip Try to Solve Red Hat Linux Kernel Compilation “It’s not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers” in Red Hat GNU/Linux.
The Solution is simply to Upgrade System so to have matching Kernel and Kernel Headers.

Fixing System
Then to Solve Kernel Compilation Issue in Red Hat Linux
Run:sudo dnf upgrade
Or:sudo yum update && sudo yum upgrade
And then:sudo reboot
Finally, possibly again:sudo dnf install kernel-devel
Or:sudo yum install kernel-devel