CC7: Problem with yum: Hack required to make it update again

Just wondering if this is of use to some:
On our CERN-CentOS7 machines, the ‘yum update’ today failed ie just
exited with this last message:

Running transaction
Warning: RPMDB altered outside of yum.
Invalid version flag: or

‘yum’ could not do anything, no update or install of individual packages,
it always failed like this, simply stopped.

Our kernel is:

uname -r


This hack was required:

Linux CentOS error msg- invalid version flag: or - Programming Help - GitHub Support Community

Then ‘yum update’ works again, have used this to install ‘dnf’ which is as I think the new recommended package manager. Then things are ok again.
Maybe this had something to do with a recent package update on CERN_CC7, if so, it should be looked at. And could ‘dnf’ be part of the regular install ?
Just saying.