在x86_64上安装了CentOS 6.3.
下面我将使用parted包演示我的问题.
运行:
yumdownloader --destdir=001 --assumeyes --resolve parted
结果下载了以下rpms:
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
如果我检查x86_64版本的parted的依赖性,我看到:
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) ...
因此,我希望也可以下载x86_64版本的libblkid.
那么,如何将i686和x86_64版本的parted下载,但解决了rpms只有i686?
yumdownloader –resolve命令并不总是下载所需包的第一层,更不用说递归依赖. repoquery命令可以更好地确定所需的包,即使它也有递归限制.
原文链接:/centos/373541.html要解决yumdownloader仅下载i686已解决的rpms的问题,请使用repoquery –requires –recursive命令获取所需包和管道列表,以列出yumdownloader命令以下载软件包.例如,要下载parted包及其第一层依赖项:
/usr/bin/repoquery --requires --recursive --resolve --pkgnarrow=all --qf "%{name}" parted | sort | uniq | xargs -r yumdownloader
在我的RHEL 6.4系统上,上面的命令下载了i686(如果适用)和所需软件包的x86_64版本:
# 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
虽然这是一个良好的开端,但缺少glibc-common软件包表明下载的软件包列表仍然不完整.要下载更完整的必需软件包列表,需要一组调用repoquery的命令,如下所示:
/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
这个命令下载的包包括glibc-common和我们第一次错过的其他几个:
# 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
这可能是比你需要的更多的软件包,但它是一个更完整的集合,包括你期望的64位软件包.