[root@localhost ~]# yum install -y yum-utils
[root@localhost ~]# mkdir -p /data1/centos/$releasever
使用yum repolist获取repoid
[root@localhost data1]# yum repolist
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base CentOS-6 - Base - mirrors.aliyun.com 6,713
epel Extra Packages for Enterprise Linux 6 - x86_64 12,587
extras CentOS-6 - Extras - mirrors.aliyun.com 47
updates CentOS-6 - Updates - mirrors.aliyun.com 952
repolist: 20,299
同步存储库时可以指定一个repoid,也可以指定多个repoid,当然前提是下载目录一致。
[root@localhost ~]# reposync -n --repoid=base --repoid=epel --repoid=extras --repoid=updates -p /data1/centos/$releasever