Skip to main content

Posts

Showing posts from August, 2022

Foreman - Repos don't show up when subscribed

I encountered the issue that when provisioning hosts, they are missing most of their repositories. Checking the logs and Content Host itself didn't help any further since everything seemed to be in order. For reference, I'm running these packages: [root@katello01 ~]# rpm -qa | grep -iE '^pulp|^candlepin|^foreman|^katello' | grep -viE 'archyslife' foreman-cli-3.3.0-1.el7.noarch katello-selinux-4.0.2-1.el7.noarch katello-debug-4.5.0-1.el7.noarch pulp-client-1.0-1.noarch pulpcore-selinux-1.3.2-1.el7.x86_64 foreman-postgresql-3.3.0-1.el7.noarch foreman-installer-katello-3.3.0-1.el7.noarch foreman-dynflow-sidekiq-3.3.0-1.el7.noarch katello-client-bootstrap-1.7.9-1.el7.noarch katello-server-ca-1.0-1.noarch foreman-release-3.3.0-1.el7.noarch candlepin-4.1.11-1.el7.noarch candlepin-selinux-4.1.11-1.el7.noarch foreman-installer-3.3.0-1.el7.noarch foreman-3.3.0-1.el7.noarch katello-certs-tools-2.9.0-1.el7.noarch katello-

RPM - Fix a broken rpmdb

A broken rpmdb can happen when packages are updated outside of rpm / yum being notified and therefore the rpmdb being in an inconsistent state or if the partition where your rpmdb resides runs out of disk space. This is the error I'm getting: error: rpmdb: BDB0113 Thread/process 6245/139652028413760 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db5 - (-30973) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed Fixing it is very simple. First, create a backup of the current rpmdb just in case things go sideways: [root@server ~]# tar -cvpJf /var/tmp/rpmdb_$(date +%F).tar.xz /var/lib/rpm/__db.* Now that you have a backup, remove the rpmdb files: [root@server ~]# rm -f /var/lib/rpm/__db.* With the rpmdb deleted, go ahead and rebuild rpm's db: [root@server ~]# rpm