Solving Kernel Compilation “It’s not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers” in CentOS GNU/Linux
Hi! This Tip Try to Solve CentOS Kernel Compilation “It’s not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers” in CentOS 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 CentOS
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