Solving Kernel Compilation “It’s not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers” on CentOS GNU/Linux
This Tip Try to Solve CentOS Kernel Compilation “It’s not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers” on CentOS GNU/Linux – Step by step Tutorial.
The Solution is simply to Upgrade System so to have matching Kernel and Kernel Headers.

Fixing System
Then to Solve Kernel Compilation Issue on CentOS
Run:sudo dnf upgrade --refresh
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