Package: yum
Version: 3.4.3-3
Severity: normal

Dear Maintainer,

After a Yum-based bootstrap, the RPM database remains empty, and thus
causes problems for rpm and Yum itself:

* RPM thinks that zero packages are installed. It will happily
  install packages that are already installed by Yum.

* Yum fails to expand the $releasever variable in /etc/yum.repos.d/;
  it tries to determine the value by querying the RPM database for the
  version of the "centos-release" package. RPM thinks the database is
  empty, and thus Yum fails to expand the variable.

I'm trying to bootstrap Centos in a directory, for later use in
squashfs. Steps to reproduce:

rootdir="/var/tmp/centos7"
apt-get install rpm yum
mkdir "$rootdir"
rpm --nodeps --root "$rootdir" -i 
http://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-1.1503.el7.centos.2.8.x86_64.rpm
sed -i "s,gpgkey=file:///etc/,gpgkey=file://${rootdir}/etc/,g" 
"$rootdir"/etc/yum.repos.d/*.repo
yum --assumeyes --installroot "$rootdir" groupinstall core
mount -t proc proc "$rootdir"/proc
chroot "$rootdir" rpm -qa

The final "rpm -qa" command returns no output.

Initializing the RPM database using "rpmdb --root=$rootdir --initdb"
has no effect on the outcome. I have tried, before the first RPM
command to install centos-release, to initialize the database in
$rootdir/var/lib/rpm and $rootdir/root/.rpmdb, but to no avail.

How is Yum supposed to synchronize with the RPM database during an
installroot bootstrap?

Reply via email to