rpm --root is broken (?)

Paweł Zuzelski z at xatka.net
Thu Jun 18 11:46:12 CEST 2009


WTF?

[root at davabel ~]# mkdir /root/test
[root at davabel ~]# rpm --root=/root/test --initdb
[root at davabel ~]# poldek -nth --noask --root=/root/test -i rpm
(...)
[root at davabel ~]# chroot /root/test
/bin/sh: No controlling tty (open /dev/tty: No such file or directory)
/bin/sh: warning: won't have full job control
/bin/sh: /etc/kshrc[22]: id: not found
/bin/sh: /etc/kshrc[22]: [: 0: unexpected operator/operand

#### And now rpm database is not available

[root at davabel /]$ rpm -qa
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
[root at davabel /]$ ^D

#### Outside chroot everything is OK

[root at davabel ~]# rpm --root=/root/test -qa | head -n1
ldconfig-2.10.1-5.i686

#### But lets try to rename chroot dir:

[root at davabel ~]# mv test test2
[root at davabel ~]# rpm --root=/root/test -qa
Freeing read locks for locker 0x21: 4927/3082521200
Freeing read locks for locker 0x23: 4927/3082521200
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /root/test2/var/lib/rpm
[root at davabel ~]# ^D
[root at davabel ~]# strace -eopen -f rpm --root=/root/test2 -qa
(...)
open("/root/test2/var/lib/rpm/Packages", O_RDONLY|O_LARGEFILE) = 3
open("/root/test/var/lib/rpm/Packages", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
            ^^^^
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /root/test2/var/lib/rpm

My system is PLD th i686

[root at davabel ~]# rpm -qa | grep rpm
rpm-4.5-21.i686
rpm-debuginfo-4.5-16.i686
rpm-php-pearprov-4.5-21.i686
rpm-build-4.5-21.i686
rpm-lib-4.5-21.i686
rpm-pythonprov-4.5-21.i686
rpm-debuginfo-4.5-14.i686
rpm-build-tools-4.4.9-17.noarch
rpm-whiteout-1.26-1.noarch
rpm-specdump-0.3-6.i686
python-rpm-4.5-21.i686
rpm-perlprov-4.5-21.i686
rpmorphan-1.4-1.noarch
rpm-base-4.5-21.i686
rpm-utils-4.5-21.i686
rpmlist-1.5-1.noarch
rpm-build-macros-1.520-2.noarch
rpm-utils-perl-4.5-21.i686
rpm-devel-4.5-21.i686
rpm-static-4.5-21.i686
rpm-javaprov-4.5-21.i686
[root at davabel ~]# rpm -qa | grep poldek
poldek-libs-0.30-0.20080820.23.30.i686
poldek-0.30-0.20080820.23.30.i686
python-poldek-0.30-0.20080820.23.30.i686
[root at davabel ~]# rpm -qa | grep db4.7  
db4.7-4.7.25-5.i686
db4.7-static-4.7.25-5.i686
db4.7-devel-4.7.25-5.i686

-- 
Paweł Zuzelski


More information about the pld-devel-en mailing list