eheh good, without rpm you would not be able to install these , you should read the whole thing before executing the commands
anyway…
yes there’s a bit of a mess , you might have installed packages manually with rpm --force, so we should understand if you have more doubles first.
rpm -qa --qf “%{NAME}\n” | sort | uniq -c | sort -r
this will return a list like
3 kernel-modules
3 kernel-core
3 kernel
2 perl-File-HomeDir
2 gpg-pubkey
1 zvbi
1 zoneminder-httpd
1 zoneminder-common
1 zoneminder
it is fine to have multiple copies of kernel packages as you might want to boot in an earlier kernel, gpg keys as well, but other packages not so much, like my perl-File-Homedir that I tried installing to make this example.
so if you have other packages with more than 1 installed, let me know, otherwise proceed…
ADDITIONALLY if you want to be SUPER careful you should also
rpm -q --whatrequires bind-license-9.9.4-61.el7_5.1.noarch
rpm -q --whatrequires glibc-common-2.17-260.el7_6.4.x86_64
rpm -q --whatrequires grub2-common-2.02-0.65.el7.centos.2.noarch
if these don’t have any packages that requires them by version you will see…
no package requires [the names of the package you asked]
so if everything is ok, bind-license, glibc-common and grub2-common are the only ones, you could:
rpm -e --nodeps bind-license-9.9.4-61.el7_5.1.noarch glibc-common-2.17-260.el7_6.4.x86_64 grub2-common-2.02-0.65.el7.centos.2.noarch
the --nodeps is extremely important or you’ll wipe half installation basically it’s telling rpm to JUST uninstall these 3 packages and not their dependencies.
I chose to remove those versions because we should preserve the version for which there’s a matching sibling (like you have glibc-common 222 and 260, but glibc is at 222, so 260 should go, UNLESS you purpusely installed that version because of some particular reason)
at this point you should be able to update.
remember to always do installations with yum as it does package dependency resolution, and does not allow forcing packages in (by design). rpm is what’s behind yum.
hope this was helpful !