I completely lost the rpm directory under /var/lib with no way to recover it. (I know what I should have done...) I have made a new one (rpm --initdb) but of course rpm and yum no longer know what's on the system. Is there a way to repopulate the database so I can do things like yum check-update again and actually get results? Or is this a lost cause. If so, how to proceed?

I'm running Centos Stream release 8.

Thanks for your suggestions

1 Answer 1

  1. You download and install using rpm the centos-release-XX-XX.noarch.rpm package.
  2. find /usr /etc -type f -print0 | xargs -0 -P$(nproc) dnf --cacheonly whatprovides | sort -u > /tmp/packages.txt
  3. You manually download the resulting packages into e.g. /tmp/packages
  4. cd /tmp/packages && rpm -ivh --noscripts --notriggers --justdb *rpm

You're all set.

Item N2 could be quite slow, there's a faster method but it's more complicated.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .