Linux下yum下载依赖包

先安装依赖包yum-plugin-downloadonly
[root@node1 ~]# yum install yum-plugin-downloadonly

方法一:
[root@node1 ~]# yum install --downloadonly nano
[root@node1 ~]# ll /var/cache/yum/x86_64/7/base/packages
-rw-r--r-- 1 root root 450136 Jul  4  2014 nano-2.3.1-10.el7.x86_64.rpm
不加--downloaddir参数,下载的依赖包会放在默认路径/var/cache/yum/x86_64/7/base/packages下。

方法二:
[root@node1 ~]# yum install --downloadonly --downloaddir=/root keepalived
[root@node1 ~]# ll
-rw-------. 1 root  root    1259 Jul  7 18:43 anaconda-ks.cfg
-rw-r--r--  1 root  root  339344 Aug 23  2019 keepalived-1.3.5-16.el7.x86_64.rpm
-rw-r--r--  1 root  root   42784 Aug 23  2019 lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64.rpm
-rw-r--r--  1 root  root  724340 Jun 24 01:36 net-snmp-agent-libs-5.7.2-48.el7_8.1.x86_64.rpm
-rw-r--r--  1 root  root  769104 Jun 24 01:36 net-snmp-libs-5.7.2-48.el7_8.1.x86_64.rpm

参考链接:
https://blog.csdn.net/leo__1990/article/details/90287941

  

posted @ 2020-07-09 22:14  orcl  阅读(3379)  评论(0编辑  收藏  举报