Under certain conditions the RPM database used by yum will become corrupt. Here is how to resolve this issue. You may see an error such as “Warning: RPMDB altered outside of yum” or “error: rpmdbNextIterator”
1. Take a backup FIRST, before trying to have rpm repair the database.
tar zcvf /var/preserve/rpmdb-[today's date].tar.gz rpm
Verify integrity with
rm -f __db* # to avoid stale locks
Next run the following:
mv Packages Packages.orig
/usr/lib/rpm/rpmdb_dump Packages.orig | /usr/lib/rpm/rpmdb_load Packages
Finally rebuild the database:
rpm -vv --rebuilddb
for the error :
mv /var/lib/rpm/Pubkeys /var/lib/rpm/Pubkeys.backup
rpm --rebuilddb -vv to recreate the index.
from : https://bugzilla.redhat.com/show_bug.cgi?id=108915
reference : http://kbase.redhat.com/faq/docs/DOC-6904#
CentOS 4 is no longer supported by the developers and we do not recommend you install it. If you have a special case which requires CentOS 4, you will find that yum will not update or perform installs because the repository URL’s are no longer valid.
To make yum work with vault.centos.org, edit your :
to have these lines:
name=CentOS-$releasever - Base
name=CentOS-$releasever - Updates
yum update, yum install, etc. will now work.
The php version on my VPS is out of date. How do I update it?
Using the OS vendors normal update command can get you some updates (but perhaps not what you want – see below). For example on RedHat/CentOS run:
yum update php
However usually the OS vendors versions are not the latest. The update them to patch security issues but many times are far out of date from what you may require.
To update RedHat/CentOS to a newer php run these commands:
yum erase php-pdo php-xml php-mysql php php-common php-cli php-gd php-mbstring php-devel
yum install php53-pdo php53-xml php53-mysql php53 php53-common php53-cli php53-gd php53-mbstring
/sbin/service httpd restart
These are “unofficial” RPM’s as RedHat only official supports a particular (semi-old) version and backports security fixes to it – good for large corporate users but not so great for active developers). However the RPMS’s above are widely used in the community and most developers view them as trustworthy (just important to note that they are not actually from RedHat).