使用yum插件downloadonly下载安装软件需要的依赖包并保留到指定的文件
安装yum-downloadonly或 yum-plugin-downloadonly 软件包。
yum install yum-plugin-downloadonly
yum -y install --downloadonly --downloaddir=/var/ftp/yum cmake gcc gcc-c++ libgcrypt* crypt* libaio libaio-devel automake autoconf bzr bison libtool ncurses5-devel libaio perl-Time-HiRes perl-DBD-MySQL perl-IO-Socket-SSL
rsync -avrt rsync://mirrors.ustc.edu.cn/centos/6.6/updates/x86_64/Packages/ /var/ftp/yum
1.保存yum安装的rpm包
编辑文件/etc/yum.conf
keepcache=0 修改默认0为1,rpm包下载后不清除
下载后保存的目录如下:
[root@localhost ~]# ls /var/cache/yum/x86_64/6/base/packages/
lrzsz-0.12.20-27.1.el6.x86_64.rpm screen-4.0.3-18.el6.x86_64.rpm