[devel] Re: ...в общее chroot-окружение -- apt+rpm problem
Alexey Tourbin
=?iso-8859-1?q?at_=CE=C1_turbinal=2Eorg?=
Вс Янв 5 22:22:11 MSK 2003
On Sun, Jan 05, 2003 at 02:44:59PM +0300, Alexey Tourbin wrote:
> Используя --root, можно создать отдельную виртуальную среду с отдельной
> RPM базой.
Я слабал скрипт (прилагается). Он работает, но на одном месте
обламывается. rpm с ним не может пересобрать cвою базу, хотя сам
по себе -- может. Т.е. лог кончается тем, что:
...
0 packages upgraded, 34 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/6996kB of archives. After unpacking 16,8MB will be used.
Do you want to continue? [Y/n]
Rebuilding RPM database (this may take a few minutes)...
error: temporary database /home/at/CHROOT/beta/var/lib/rpm already exists
E: could not rebuild RPM database for upgrade of RPM
$
Причем:
$ sudo rpm -v --rebuilddb --root /home/at/CHROOT/beta
rebuilding database /home/at/CHROOT/beta/var/lib/rpm
$ rpm -q apt rpm
apt-0.3.19cnc55-alt3
rpm-4.0.4-alt12
$
Прилагается вывод команд
$ sudo ./mkchroot $HOME/CHROOT/beta coreutils sh
$ sudo ./mkchroot $HOME/CHROOT/beta rpm
--
WBR, Alexey Tourbin
BIOZAK Ltd., Russia
----------- следующая часть -----------
#!/bin/sh -ex
#
# mkchroot /chroot_path [packages]
# setup chrooted environment in $HOME/CHROOT*
#
CHROOT=$1; shift
if [ -z "$HOME" ] || [ -z "$CHROOT" ] || [ -n "${CHROOT##$HOME/CHROOT*}" ] ; then
echo "bad CHROOT=$CHROOT"
exit 1
fi
rm -rf $CHROOT
mkdir -p $CHROOT/{bin,etc/rpm,usr/lib/rpm,var/lib/rpm}
cp -a /bin/rpm $CHROOT/bin/
cp -a /usr/lib/rpm/{rpmrc,macros} $CHROOT/usr/lib/rpm/
echo "%_dbapi 3" > $CHROOT/etc/rpm/macros.db1
rpm --initdb --root $CHROOT
apt-get install -o RPM::RootDir=$CHROOT setup
apt-get install -o RPM::RootDir=$CHROOT glibc-core
apt-get install -o RPM::RootDir=$CHROOT $*
chroot $CHROOT /bin/echo 'hi!'
chroot $CHROOT /bin/sh
----------- следующая часть -----------
+ CHROOT=/home/at/CHROOT/beta
+ shift
+ '[' -z /home/at ']'
+ '[' -z /home/at/CHROOT/beta ']'
+ '[' -n '' ']'
+ rm -rf /home/at/CHROOT/beta
+ mkdir -p /home/at/CHROOT/beta/bin /home/at/CHROOT/beta/etc/rpm /home/at/CHROOT/beta/usr/lib/rpm /home/at/CHROOT/beta/var/lib/rpm
+ cp -a /bin/rpm /home/at/CHROOT/beta/bin/
+ cp -a /usr/lib/rpm/rpmrc /usr/lib/rpm/macros /home/at/CHROOT/beta/usr/lib/rpm/
+ echo '%_dbapi 3'
+ rpm --initdb --root /home/at/CHROOT/beta
+ apt-get install -o RPM::RootDir=/home/at/CHROOT/beta setup
Processing File Dependencies...
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
setup
0 packages upgraded, 1 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/25,1kB of archives. After unpacking 35,6kB will be used.
Executing RPM (/bin/rpm -r /home/at/CHROOT/beta -Uv --replacepkgs -h --fancypercent)...
Preparing... ##################################################
setup ##################################################
+ apt-get install -o RPM::RootDir=/home/at/CHROOT/beta glibc-core
Processing File Dependencies...
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
glibc-core
0 packages upgraded, 1 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/947kB of archives. After unpacking 2167kB will be used.
Executing RPM (/bin/rpm -r /home/at/CHROOT/beta -Uv --replacepkgs -h --fancypercent)...
Preparing... ##################################################
glibc-core ##################################################
+ apt-get install -o RPM::RootDir=/home/at/CHROOT/beta coreutils sh
Processing File Dependencies...
Reading Package Lists...
Building Dependency Tree...
The following extra packages will be installed:
bzip2 bzlib gzip info-install libtinfo terminfo
The following NEW packages will be installed:
bzip2 bzlib coreutils gzip info-install libtinfo sh terminfo
0 packages upgraded, 8 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/2426kB of archives. After unpacking 6059kB will be used.
Do you want to continue? [Y/n] Executing RPM (/bin/rpm -r /home/at/CHROOT/beta -Uv --replacepkgs -h --fancypercent)...
Preparing... ##################################################
terminfo ##################################################
gzip ##################################################
libtinfo ##################################################
sh ##################################################
warning: created %_tmppath directory /var/tmp
coreutils ##################################################
/var/tmp/rpm-tmp.96704: line 6: /sbin/install-info: No such file or directory
error: execution of %post scriptlet from coreutils-4.5.3-alt2 failed, exit status 127
bzlib ##################################################
bzip2 ##################################################
info-install ##################################################
E: Sub-process /bin/rpm returned an error code (8)
----------- следующая часть -----------
+ CHROOT=/home/at/CHROOT/beta
+ shift
+ '[' -z /home/at ']'
+ '[' -z /home/at/CHROOT/beta ']'
+ '[' -n '' ']'
+ rm -rf /home/at/CHROOT/beta
+ mkdir -p /home/at/CHROOT/beta/bin /home/at/CHROOT/beta/etc/rpm /home/at/CHROOT/beta/usr/lib/rpm /home/at/CHROOT/beta/var/lib/rpm
+ cp -a /bin/rpm /home/at/CHROOT/beta/bin/
+ cp -a /usr/lib/rpm/rpmrc /usr/lib/rpm/macros /home/at/CHROOT/beta/usr/lib/rpm/
+ echo '%_dbapi 3'
+ rpm --initdb --root /home/at/CHROOT/beta
+ apt-get install -o RPM::RootDir=/home/at/CHROOT/beta setup
Processing File Dependencies...
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
setup
0 packages upgraded, 1 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/25,1kB of archives. After unpacking 35,6kB will be used.
Executing RPM (/bin/rpm -r /home/at/CHROOT/beta -Uv --replacepkgs -h --fancypercent)...
Preparing... ##################################################
setup ##################################################
+ apt-get install -o RPM::RootDir=/home/at/CHROOT/beta glibc-core
Processing File Dependencies...
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
glibc-core
0 packages upgraded, 1 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/947kB of archives. After unpacking 2167kB will be used.
Executing RPM (/bin/rpm -r /home/at/CHROOT/beta -Uv --replacepkgs -h --fancypercent)...
Preparing... ##################################################
glibc-core ##################################################
+ apt-get install -o RPM::RootDir=/home/at/CHROOT/beta rpm
Processing File Dependencies...
Reading Package Lists...
Building Dependency Tree...
The following extra packages will be installed:
alt-gpgkeys bzip2 bzlib coreutils crontabs gawk grep gzip info-install
libbeecrypt libdb2 libdb4 libpam libpcre libpopt librpm libtcb libtinfo
logrotate mktemp nss_tcb pam pam-config pam_passwdqc pam_tcb pam_userpass
perl-base sh shadow-convert shadow-utils tcb-utils terminfo zlib
The following NEW packages will be installed:
alt-gpgkeys bzip2 bzlib coreutils crontabs gawk grep gzip info-install
libbeecrypt libdb2 libdb4 libpam libpcre libpopt librpm libtcb libtinfo
logrotate mktemp nss_tcb pam pam-config pam_passwdqc pam_tcb pam_userpass
perl-base rpm sh shadow-convert shadow-utils tcb-utils terminfo zlib
0 packages upgraded, 34 newly installed, 0 to remove(replace) and 0 not upgraded.
Need to get 0B/6996kB of archives. After unpacking 16,8MB will be used.
Do you want to continue? [Y/n] Rebuilding RPM database (this may take a few minutes)...
error: temporary database /home/at/CHROOT/beta/var/lib/rpm already exists
E: could not rebuild RPM database for upgrade of RPM
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя : =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Тип : application/pgp-signature
Размер : 189 байтов
Описание: =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Url : <http://lists.altlinux.org/pipermail/devel/attachments/20030105/d53c8b55/attachment-0001.bin>
Подробная информация о списке рассылки Devel