方法一: yumdownloader [[email protected] ~]# rpm -qa |grep yum-utils [[email protected] ~]# yum -y install yum-utils* [[email protected] ~]# rpm -ql yum-utils /usr/bin/debuginfo-install /usr/bin/package-cleanup /usr/bin/repo-graph /usr/bin/repo-rss /usr/bin/repoclosure /usr/bin/repodiff /usr/bin/repomanage /usr/bin/repoquery /usr/bin/reposync /usr/bin/repotrack /usr/bin/verifytree /usr/bin/yum-builddep /usr/bin/yum-debug-dump /usr/bin/yum-groups-manager /usr/bin/yumdownloader #可以看到yumdownloade这个工具是由yum-utils这个软件安装生成的! 安装好后就可以直接使用了,使用非常简单,如下: [[email protected] ~]# yumdownloader vlock Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.centos.org * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirrors.btte.net vlock-1.3-23.i386.rpm | 11 kB 00:00 [[email protected] ~]# ls sys_init.sh vlock-1.3-23.i386.rpm 方法二: 使用yum的一个插件:yum-downloadonly 安装yum-downloadonly [[email protected] ~]# yum -y install yum-downloadonly [[email protected] ~]# rpm -q yum-downloadonly yum-downloadonly-1.1.16-21.el5.centos 使用方法也非常简单: [[email protected] ~]# rpm -e vlock [[email protected] ~]# yum -y install --downloadonly --downloaddir=/tmp/ vlock [[email protected] ~]# ll /tmp/ total 12 -rw-r--r-- 1 root root 11182 Nov 19 2007 vlock-1.3-23.i386.rpm #--downloadonly 说明只下载, --downloaddir 指定安装到哪个目录下。
时间: 2024-12-15 05:29:14