I've been dealing with this on a Linux system that I administer. CentOS 7 was installed there by someone else. This person chose to install both release and debug versions of the Linux kernel. Even after I removed the debug kernel installation, every time there was a kernel update, yum installed two entries in grub2.cfg for the new kernel, one for debug, one for release.

This was very annoying, and fixing it with grubby was an error-prone process, as the two entries referred to the same kernel image, so it was not possible to remove just one. Both had to be removed, and then the correct one added. On at least one occasion, I managed to render the system unbootable through a stupid typo.

Of course I knew that there had to be a "proper" solution. And indeed there was. The culprit was the file  /etc/sysconfig/kernel. In it, a single line:


Deleting or commenting out this line resolved the problem. Today, there was a kernel update. When it was done, there was only one new entry in grub2.cfg and it was the correct one. Phew!