[root@192-168-80-131 ~]# cat /etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releasever #默认保存位置 keepcache=1 #改为1,保存下在的rpm包
yum install wget wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
默认目录
[root@192-168-80-131 7]# find / -name *.rpm/var/cache/yum/x86_64/7/base/packages/wget-1.14-18.el7_6.1.x86_64.rpm
指定目录
[root@192-168-80-131 srvadmin]# pwd /root/srvadmin [root@192-168-80-131 srvadmin]# yum install --downloadonly --downloaddir=./ ansible -y [root@192-168-80-131 srvadmin]# ls ansible-2.9.27-1.el7.noarch.rpm python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm python-ply-3.4-11.el7.noarch.rpm libyaml-0.1.4-11.el7_0.x86_64.rpm python-cffi-1.6.0-5.el7.x86_64.rpm python-pycparser-2.14-1.el7.noarch.rpm python2-cryptography-1.7.2-2.el7.x86_64.rpm python-enum34-1.0.4-1.el7.noarch.rpm python-setuptools-0.9.8-7.el7.noarch.rpm python2-httplib2-0.18.1-3.el7.noarch.rpm python-idna-2.4-1.el7.noarch.rpm python-six-1.9.0-2.el7.noarch.rpm python2-jmespath-0.9.4-2.el7.noarch.rpm python-ipaddress-1.0.16-2.el7.noarch.rpm PyYAML-3.10-11.el7.x86_64.rpm python2-pyasn1-0.1.9-7.el7.noarch.rpm python-jinja2-2.7.2-4.el7.noarch.rpm sshpass-1.06-2.el7.x86_64.rpm python-babel-0.9.6-8.el7.noarch.rpm python-markupsafe-0.11-10.el7.x86_64.rpm python-backports-1.0-8.el7.x86_64.rpm python-paramiko-2.1.1-9.el7.noarch.rpm