Linux – Yum install in chroot directory

fedoralinuxyum

I'm trying to install the Base group on a mounted volume.

Here's the custom yum.conf that I'm using:

[main]
cachedir=/var/cache/yum/
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
obsoletes=1
gpgcheck=0
reposdir=/dev/null


[base]
name=Fedora 13 - i386
baseurl=file:///media/Fedora\ 13\ i386\ DVD/
enabled=1

[updates]
name=Fedora 13 - i386 - Updates
baseurl=http://mirror.sov.uk.goscomb.net/fedora/linux/updates/13/i386/
enabled=1

When I run

# yum -c yum.conf --installroot=mnt groupinstall Base

I would expect yum to install everything under mnt

But it keeps on saying:

[...]
Package irda-utils-0.9.18-10.fc12.i686 already installed and latest version
Package time-1.7-37.fc12.i686 already installed and latest version
Package man-pages-3.23-6.fc13.noarch already installed and latest version
Package talk-0.17-33.2.4.i686 already installed and latest version
Package pam_passwdqc-1.0.5-6.fc13.i686 already installed and latest version
[...]

I tried

rpm --base=mnt --initdb

and then use rpm to install fedora-release (which worked and installed the package under /mnt)

But yum keeps on saying that all packages are installed.

Any ideas?…

Best Answer

sorted.

mnt must be an absolute path rather than relative (which I was using).

replaced:

--installroot=mnt

with

--installroot=/full/path/mnt

and all's good now.