Centos – yumdownloader downloads only i686 resolved rpms

centosredhatyum

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?

Best Answer

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.