Today I need to install a plugin named tree. But there is an error occurred as follow when I input yum command.

    1. [root@VM-0-8-centos ~]# yum install -y tree
    1. error: rpmdb: BDB0113 Thread/process 14662/139787824154688 failed: BDB1507 Thread died in Berkeley DB library
    2. error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
    3. error: cannot open Packages index using db5 - (-30973)
    4. error: cannot open Packages database in /var/lib/rpm
    5. CRITICAL:yum.main:
    6. Error: rpmdb open failed

    The solution is to rebuild rpm db.

    1. cd /var/lib/rpm
    1. rm -rf __db*
    1. rpm --rebuilddb