Fix error BDB0091 DB_VERSION_MISMATCH when running alien on Ubuntu

I was trying to convert a rpm package to deb package using alien and I got this error:

$ sudo alien -d mypackage.rpm

error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 -  (-30969)
error: cannot open Packages database in /home/trinh/.rpmdb

It is because this is the first time I run alien on Ubuntu and the system did not have any rpm database. So, to get rid of the error, run the following command to install RPM DB:

sudo rpm --rebuilddb