Ste*_*ski 8 linux redhat fedora yum rpm
我想在http://yum.puppetlabs.com/镜像以下 Yum/RPM 存储库:
Puppet 存储库包含曾经发布的所有 Puppet 产品,并且非常大,大约 8GB。我只需要镜像文件的最新版本。
我尝试使用reposync --newest-only
以下方法镜像存储库:
reposync --config=puppetlabs.repo.el6 --repoid=puppetlabs-products --repoid=puppetlabs-deps --newest-only --download_path=el/6 --quiet --downloadcomps
Run Code Online (Sandbox Code Playgroud)
这会下载我需要的最新软件包。然而,reposync不会自动创建的常规目录结构(x86_64
,noarch
,SRPMS
等),并且不反射镜repodata.xml
。结果,我的 yum 客户收到如下错误:
[root@web1 ~]# yum --quiet install puppet
http://mirrors.example.org/pub/puppet/el/6/puppetlabs-deps/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: puppetlabs-deps. Please verify its path and try again
[root@web1 ~]#
Run Code Online (Sandbox Code Playgroud)
有没有办法以编程方式仅镜像来自 Yum 存储库的新文件并遵循标准存储库目录结构?
reposync 是唯一可靠的方法。您需要创建一个小的 bash 脚本并使用 reposync 参数 (-a) 将每个架构下载到单独的文件夹中,然后运行createrepo以生成元数据。
这是我拥有的一个小脚本(它在 Ubuntu 上运行,但没关系,你懂的):
#!/bin/bash
reposync -n -c /etc/yum/yum.conf -p /repos/centos6 -d -r base -r updates -r extras -r centosplus -r contrib
createrepo -g /repos/centos6/base/repodata/comps.xml /repos/centos6/base
createrepo /repos/centos6/updates
createrepo /repos/centos6/extras
createrepo /repos/centos6/centosplus
reposync -n -c /etc/yum/yum.conf -p /repos -d -r vmware -r home_xtreemfs
createrepo /repos/vmware
createrepo /repos/home_xtreemfs
reposync -n -c /etc/yum/yum.conf -p /repos/vz -d -r openvz-utils -r openvz-kernel-rhel6
createrepo /repos/vz/openvz-utils
createrepo /repos/vz/openvz-kernel-rhel6
reposync -n -c /etc/yum/yum.conf -p /repos/nginx -d -r nginx-stable -r nginx-mainline
createrepo /repos/nginx/nginx-stable
createrepo /repos/nginx/nginx-mainline
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
23110 次 |
最近记录: |