Download all packages in the yum repository

1. Configure the yum warehouse

omitted here

2. Install the synchronization tool

[root@node01 ~]# yum -y install yum-utils     #执行安装软件包

3. Synchronize the yum warehouse

reposync:This command is very powerful and can download all the installation packages in the remote Yum warehouse to the local directory. 该命令是来自于 yum-utils 软件包里面的。

 Description of common parameters:

  •  -r : Specify the name of the repo source of the locally configured yum warehouse
  •  -p : Specify the path to download
[root@node01 yum.repos.d]# yum repolist
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
repo id                                                                                                      repo name                                                                                                                  status
base/7/x86_64                                                                                                CentOS-7 - Base - mirrors.aliyun.com                                                                                        10,072
centos-openstack-queens/7/x86_64                                                                             CentOS-7 - OpenStack queens                                                                                                3,114+2
epel/x86_64                                                                                                  Extra Packages for Enterprise Linux 7 - x86_64                                                                              13,771
extras/7/x86_64                                                                                              CentOS-7 - Extras - mirrors.aliyun.com                                                                                         515
phyrepo                                                                                                      centos                                                                                                                       9,363
updates/7/x86_64                                                                                             CentOS-7 - Updates - mirrors.aliyun.com                                                                                      4,886
repolist: 41,721
[root@node01 yum.repos.d]# 

 Synchronize packages based on repo id

[root@node01 yum.repos.d]# mkdir /root/aliyun


[root@node01 yum.repos.d]# reposync -r extras -p /root/aliyun/    
#根据每个据仓库标识下载安装包到本地目录
[extras: 1     of 47    ] Downloading Packages/bakefile-0.2.8-3.el6.centos.x86_64.rpm
bakefile-0.2.8-3.el6.centos.x86_64.rpm  

Guess you like

Origin blog.csdn.net/zyqash/article/details/130220665