方法1:yum --downloadonly
yum命令的参数有很多,其中就有只是下载而不需要安装的命令,并且也会自动解决依赖;通常和【–downloaddir】参数一起使用
yum install --downloadonly --downloaddir=/opt zlib zlib-devel libaio cmake make gcc gcc-c++ readline readline-devel perl bison flex libyaml net-tools expect openssh-clients tcl openssl openssl-devel ncurses-devel python python-devel openldap pam systemtap-sdt-devel perl-ExtUtils-Embed libxml2 libxml2-devel libxslt libxslt-devel uuid-devel
如果已经下载,可以用reinstall
yum reinstall --downloadonly --downloaddir=/opt zlib zlib-devel libaio cmake make gcc gcc-c++ readline readline-devel perl bison flex libyaml net-tools expect openssh-clients tcl openssl openssl-devel ncurses-devel python python-devel openldap pam systemtap-sdt-devel perl-ExtUtils-Embed libxml2 libxml2-devel libxslt libxslt-devel uuid-devel
方法2:yumdownloader
yumdownloader --destdir=/tmp --resolve lrzsz