Bug 850686 - yum --installroot doest not work
Summary: yum --installroot doest not work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum
Version: 6.3
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-22 07:15 UTC by hydra35
Modified: 2014-01-21 06:25 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-23 19:26:14 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description hydra35 2012-08-22 07:15:33 UTC
Description of problem:

When using --installroot option to install package to a specific directory, such as /usr/local/nginx, yum always uses an incorrect URL to get repomd.xml: http://mirrors.163.com/centos/%24releasever. The correct one should be http://mirrors.163.com/centos/6.

The command also produces unrelated files in the intended installroot:

/usr/local/nginx
└── var
    ├── cache
    │   └── yum
    │       └── x86_64
    │           └── $releasever
    │               ├── base
    │               │   └── packages
    │               ├── epel
    │               │   ├── metalink.xml
    │               │   └── packages
    │               └── timedhosts.txt
    ├── lib
    │   ├── rpm
    │   │   ├── Name
    │   │   ├── Packages
    │   │   └── Providename
    │   └── yum
    │       ├── repos
    │       │   └── x86_64
    │       │       └── $releasever
    │       │           ├── base
    │       │           └── epel
    │       └── uuid
    ├── log
    │   └── yum.log
    └── run


Version-Release number of selected component (if applicable):
yum: 3.2.29

How reproducible:

# yum --installroot=/usr/local/nginx install nginx

Loaded plugins: fastestmirror, presto
Determining fastest mirrors
epel/metalink                                                                                                                                              | 4.5 kB     00:00     
Including mirror: mirror.neu.edu.cn
Including mirror: mirrors.ustc.edu.cn
 * epel: mirror.neu.edu.cn
http://mirrors.163.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again



Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 James Antill 2012-08-23 19:26:14 UTC
 When using --installroot everything is done within the chroot, so yum can't find out what $releasever maps to (it normally does this by reading /var/lib/rpm).
 There are two workarounds:

Pass: --releasever=6
Pass: --releasever=/

...the later tells yum to lookup this value from the /var/lib/rpm outside the chroot.


Note You need to log in before you can comment on or make changes to this bug.