The RPM package information stored in the below location
The RPM database is used to keep track of all files that are changed and created when a user installs a package. If the database gets corrupted, the index databases can be recreated with the rpm --rebuilddb command.
If you issues the rpm- qa ( query ) command then, it will read from the DB and list out the package names.
If you delete the installation directory directly, it won’t delete the record from the RPM DB. For that you need to execute the rpm –ivh (uninstall ) command , otherwise you can’t install the same package.