New to linux, and was updating software. I had clicked the link to change system packages to the ones in the packman repo.

After hitting accept everything went well until it was at least 90% done, and then it froze, mouse stopped moving.

So I waited a while, and after nothing happened I rebooted my computer. Now the first time I tried to go back into the software update section it gave me an error:

"cannot read the list of installed packages"

and kicked me out.

After trying to go in again this time it worked, however it won't install anything anymore and just gives me the error that whatever I want to install failed, for example trying to install VLC and dependancies gives me:

Subprocess failed. Error: RPM failed: rpmdb: PANIC: Invalid argument
rpmdb: PANIC: fatal region error detected; run recovery
error: db3 error(-30977) from dbcursor->c_put: DB_RUNRECOVERY: Fatal error, run database recovery

how do I recover the installed packages database, or rebuild it?