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