shell
reposync [选项]
reposync用于将远程yum存储库同步到本地目录,使用yum检索包。
shell
-h, --help
<h1>显示帮助信息</h1>
-c CONFIG, --config=CONFIG
<h1>指定配置文件(默认为/etc/yum.conf)</h1>
-a ARCH, --arch=ARCH
<h1>指定arch</h1>
--source
<h1>同时下载src和rpm文件.</h1>
-r REPOID, --repoid=REPOID
<h1>指定要查询的repo id,可以指定多次(默认为全部启用)。</h1>
-e CACHEDIR, --cachedir CACHEDIR
<h1>存储元数据的目录。</h1>
-t, --tempcache
<h1>使用临时目录存储/访问yum-cache。</h1>
-d, --delete
<h1>删除存储库中不再存在的本地包。</h1>
-p DESTDIR, --download_path=DESTDIR
<h1>指定下载路径:默认为当前目录。</h1>
--norepopath
<h1>不要将重命名添加到下载路径中。只能在同步单个存储库时使用(默认是添加重命名)。</h1>
-g, --gpgcheck
<h1>下载后删除GPG签名检查失败的包。如果至少有一个包被删除,退出状态为“1”。</h1>
-u, --urls
<h1>只列出要下载的内容的url,不要下载。</h1>
-l, --plugins
<h1>启用yum插件支持。</h1>
-m, --downloadcomps
<h1>同时下载comps.xml。</h1>
--download-metadata
<h1>下载所有非默认元数据。</h1>
-n, --newest-only
<h1>每个repo只下载最新的包。</h1>
-q, --quiet
<h1>输出尽可能少的信息。</h1>
--allow-path-traversal
<h1>允许同步存储在repo目录之外的包。这些包是在元数据中通过使用绝对路径或上一级“..”系统引用的并且出于安全原因通常会在reposync中跳过。</h1>
<h1>注意:使用此选项有潜在的安全隐患,因为通过提供恶意repodata,攻击者可以使reposync写入任意位置运行该文件系统的用户可以访问的文件系统。</h1>
shell
<h1>将'updates'仓库中的所有包同步到当前目录:</h1>
reposync --repoid=updates
<h1>只同步最新的包从'updates'仓库到当前目录:</h1>
reposync -n --repoid=updates
<h1>将'updates'和'extras'仓库中的包同步到当前目录:</h1>
reposync --repoid=updates --repoid=extras
<h1>将'updates'仓库中的所有包同步到repos目录:</h1>
reposync -p repos --repoid=updates
<h1>将'updates'仓库中的所有包同步到repos目录,排除x86_64架构文件。编辑/etc/yum.conf,添加选项exclude=*.x86_64。再执行:</h1>
reposync -p repos --repoid=updates
reposync使用yum库来检索信息和包。如果没有指定配置文件,将使用默认的yum配置。
* /etc/yum.conf
* /etc/yum/repos.d/