C/C++教程

yum 保存安装包-centos

本文主要是介绍yum 保存安装包-centos,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

[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

 

这篇关于yum 保存安装包-centos的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!