This may not be a serious issue at all, see here:
The yum message "Warning: RPMDB altered outside of yum." [...] means some application has altered
the rpm database (installed or removed a package) without going
through the Yum APIs. This is almost always due to someone using rpm
directly (Ie. rpm -ivh blah.rpm), but another possibility is an
application built on top of the rpm APIs (Ie. smart, apt, zypp).
So it may have been something you did inadvertently, or some piece of software did. Hopefully it is not a big deal and can be resolved with:
yum clean all
Have a look at CLEAN OPTIONS in man yum
to understand what that does. Basically it gets rid of any locally cached data to do with RPMDB; normally this is used to speed up transactions, so next time you run yum it will probably take a little bit longer because it needs to replace the (corrupted) data you just cleaned out.
yum history sync
worked for me. – arupgsh Oct 26 '22 at 19:07