Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Having CentOS 6.3 installed on x86_64.

Below I'll demonstrate my problem using parted package.

Running:

yumdownloader --destdir=001 --assumeyes --resolve parted

As a result downloaded the following rpms are:

ls -1 001/
device-mapper-libs-1.02.74-10.el6_3.3.i686.rpm
libblkid-2.17.2-12.7.el6_3.i686.rpm
libselinux-2.0.94-5.3.el6.i686.rpm
libsepol-2.0.41-4.el6.i686.rpm
libudev-147-2.42.el6.i686.rpm
libuuid-2.17.2-12.7.el6_3.i686.rpm
ncurses-libs-5.7-3.20090208.el6.i686.rpm
parted-2.1-18.el6.i686.rpm
parted-2.1-18.el6.x86_64.rpm
readline-6.0-4.el6.i686.rpm

If I examine dependency of x86_64 version of parted I see:

rpm -qp --requires 001/parted-2.1-18.el6.x86_64.rpm

/bin/sh
...
libblkid.so.1()(64bit)
libblkid.so.1(BLKID_2.15)(64bit)
libblkid.so.1(BLKID_2.17)(64bit)
...

Therefore, I expect x86_64 version of libblkid to be downloaded too.

So, how both i686 and x86_64 version of parted downloaded, but resolved rpms are only only i686?

share|improve this question

1 Answer 1

The yumdownloader --resolve command does not always download even the first layer of the required packages, let alone the recursive dependencies. The repoquery command does a better job of determining the required packages even though it too has a recursion limit.

To solve the problem where yumdownloader downloads only i686 resolved rpms, use the repoquery --requires --recursive command to obtain the list of required packages and pipe that list to the yumdownloader command to download the packages. For example, to download the parted package and its first layer of dependencies:

/usr/bin/repoquery --requires --recursive --resolve --pkgnarrow=all --qf "%{name}" parted | sort | uniq | xargs -r yumdownloader

On my RHEL 6.4 system, the above command downloaded the i686 (where applicable) and the x86_64 versions of the required packages:

# ls -1
bash-4.1.2-14.el6.x86_64.rpm
device-mapper-libs-1.02.77-9.el6.i686.rpm
device-mapper-libs-1.02.77-9.el6.x86_64.rpm
glibc-2.12-1.107.el6.i686.rpm
glibc-2.12-1.107.el6.x86_64.rpm
info-4.13a-8.el6.x86_64.rpm
libblkid-2.17.2-12.9.el6_4.3.i686.rpm
libblkid-2.17.2-12.9.el6_4.3.x86_64.rpm
libselinux-2.0.94-5.3.el6.i686.rpm
libselinux-2.0.94-5.3.el6.x86_64.rpm
libsepol-2.0.41-4.el6.i686.rpm
libsepol-2.0.41-4.el6.x86_64.rpm
libuuid-2.17.2-12.9.el6_4.3.i686.rpm
libuuid-2.17.2-12.9.el6_4.3.x86_64.rpm
ncurses-libs-5.7-3.20090208.el6.i686.rpm
ncurses-libs-5.7-3.20090208.el6.x86_64.rpm
parted-2.1-19.el6.i686.rpm
parted-2.1-19.el6.x86_64.rpm
readline-6.0-4.el6.i686.rpm
readline-6.0-4.el6.x86_64.rpm

While this is a good start, the absence of the glibc-common package indicates that the list of downloaded packages is still incomplete. To download a more complete list of the required packages takes a set of commands that invokes repoquery twice as done here:

/usr/bin/repoquery --requires --recursive --resolve --pkgnarrow=all --qf "%{name}" parted | sort | uniq | xargs rpm -q --requires | sort | uniq | awk '{print $1}' | grep -v rpmlib | xargs -n1 -r -i{}  yum -q resolvedep "{}" | sort | uniq | xargs -r -n1 /usr/bin/repoquery --requires --recursive --resolve --pkgnarrow=all --qf "%{name}" | sort | uniq | xargs -r -n 1 yumdownloader -q

The packages downloaded by this command includes glibc-common and several others that we missed the first time:

# ls -1
basesystem-10.0-4.el6.noarch.rpm
bash-4.1.2-14.el6.x86_64.rpm
device-mapper-1.02.77-9.el6.x86_64.rpm
device-mapper-libs-1.02.77-9.el6.i686.rpm
device-mapper-libs-1.02.77-9.el6.x86_64.rpm
filesystem-2.4.30-3.el6.x86_64.rpm
glibc-2.12-1.107.el6.i686.rpm
glibc-2.12-1.107.el6.x86_64.rpm
glibc-common-2.12-1.107.el6.x86_64.rpm
info-4.13a-8.el6.x86_64.rpm
libblkid-2.17.2-12.9.el6_4.3.i686.rpm
libblkid-2.17.2-12.9.el6_4.3.x86_64.rpm
libcap-2.16-5.5.el6.i686.rpm
libcap-2.16-5.5.el6.x86_64.rpm
libgcc-4.4.7-3.el6.i686.rpm
libgcc-4.4.7-3.el6.x86_64.rpm
libselinux-2.0.94-5.3.el6.i686.rpm
libselinux-2.0.94-5.3.el6.x86_64.rpm
libsepol-2.0.41-4.el6.i686.rpm
libsepol-2.0.41-4.el6.x86_64.rpm
libudev-147-2.46.el6.i686.rpm
libudev-147-2.46.el6.x86_64.rpm
libuuid-2.17.2-12.9.el6_4.3.i686.rpm
libuuid-2.17.2-12.9.el6_4.3.x86_64.rpm
ncurses-base-5.7-3.20090208.el6.x86_64.rpm
ncurses-libs-5.7-3.20090208.el6.i686.rpm
ncurses-libs-5.7-3.20090208.el6.x86_64.rpm
nss-softokn-freebl-3.12.9-11.el6.i686.rpm
nss-softokn-freebl-3.12.9-11.el6.x86_64.rpm
parted-2.1-19.el6.i686.rpm
parted-2.1-19.el6.x86_64.rpm
readline-6.0-4.el6.i686.rpm
readline-6.0-4.el6.x86_64.rpm
setup-2.8.14-20.el6.noarch.rpm
tzdata-2013b-1.el6.noarch.rpm
udev-147-2.46.el6.x86_64.rpm
util-linux-ng-2.17.2-12.9.el6_4.3.i686.rpm
util-linux-ng-2.17.2-12.9.el6_4.3.x86_64.rpm
zlib-1.2.3-29.el6.i686.rpm
zlib-1.2.3-29.el6.x86_64.rpm

This is probably a lot more packages than you need, but it is a more complete set and includes the 64-bit packages you expected.

share|improve this answer
1  
not working. It brings parted.x86_64, but not resolved packages. I suspect because the resolves packages already installed (I'm x86_64 platform) –  dimba Jan 24 '13 at 5:29
    
@dimba, If what you want to do is to install parted.x86_64, that should be as simple as yum install parted.x86_64 and yum will resolve all of the dependencies or tell you why it cannot. If instead you want to download the packages, then you need to be aware that yumdownloader does not always download all of the required packages in the way that we would expect in spite of the --resolve flag and that you will need to identify and download those packages separately. –  ZaSter Jan 25 '13 at 1:20
    
I need only to download packages, to be included in my distro. Do you know what yumdownloader --resolve is supposed to bing? Do you have a good reference to it? Are you familiar with repotrack? –  dimba Jan 25 '13 at 18:43
    
@dimba, According to the yumdownloader manual page, --resolve will "resolve dependencies and also download the required packages", which I think might imply "if they are not already installed." repotrack sounded promising, but I have not been able to get it to work. –  ZaSter Jan 28 '13 at 23:04
    
@dimba I've updated my answer with a way to force yumdownloader to download the RPM's dependencies and the RPM itself. –  ZaSter Jan 28 '13 at 23:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.