Bug 850686 - yum --installroot doest not work
yum --installroot doest not work
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum (Show other bugs)
6.3
Unspecified Linux
unspecified Severity high
: rc
: ---
Assigned To: James Antill
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-22 03:15 EDT by hydra35
Modified: 2014-01-21 01:25 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-23 15:26:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description hydra35 2012-08-22 03:15:33 EDT
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 15:26:14 EDT
 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.