2

I have a chroot environment in a directory. I want to install some RPM packages using the repositories in that chroot environment instead of the host OS ones.

yum --installroot= will look for packages repositories only in myroot/etc/yum.repos.d or it will only/also look in /etc/yum/repos.d? RHEL 6 is having the latter behavior. If that is expected behavior, what is the best method to achieve what I need?

Thanks in advance.

2 Answers 2

1

I you start yum from within the chroot, it will only look in myroot/etc/yum.repos.d. If you start it from the normal system, it will always look in /etc/yum.repos.d.

So just start yum from within chroot. Of course you will first have to install yum and everything needed for it in the chroot.

0

For all yum dists you can define your own configuration by:

yum -c myyum.conf --installroot=....

and create the myyum.conf file e.g.

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1
debuglevel=1
logfile=/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
distroverpkg=centos-release
reposdir=./my_yum.repos.d/
metadata_expire=90m
http_caching=all
color=off

which will in this case look for the repos in ./my_yum.repos.d/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .