pkgrepo.1 revision 3139
3139N/A<!ENTITY % ent SYSTEM "entities.ent">
3139N/A<refmeta><refentrytitle>pkgrepo</refentrytitle><manvolnum>1</manvolnum> <refmiscinfo class="date">2014 年 3 月 27 日</refmiscinfo> <refmiscinfo class="sectdesc">&man1;</refmiscinfo> <refmiscinfo class="software">&release;</refmiscinfo> <refmiscinfo class="arch">generic</refmiscinfo> <refmiscinfo class="copyright">Copyright (c) 2007, 2014, Oracle and/or its affiliates.All rights reserved.</refmiscinfo>
3139N/A<synopsis>/usr/bin/pkgrepo create [--version <replaceable>ver</replaceable>] <replaceable>uri_or_path</replaceable></synopsis>
3139N/A -s <replaceable>repo_uri_or_path</replaceable> <replaceable>publisher</replaceable> ...</synopsis>
3139N/A<synopsis>/usr/bin/pkgrepo get [-F <replaceable>format</replaceable>] [-H] [-p <replaceable>publisher</replaceable>]...
3139N/A -s <replaceable>repo_uri_or_path</replaceable> [--key <replaceable>ssl_key</replaceable> --cert <replaceable>ssl_cert</replaceable>]...
3139N/A<synopsis>/usr/bin/pkgrepo info [-F <replaceable>format</replaceable>] [-H] [-p <replaceable>publisher</replaceable>]...
3139N/A -s <replaceable>repo_uri_or_path</replaceable> [--key <replaceable>ssl_key</replaceable> --cert <replaceable>ssl_cert</replaceable>]...</synopsis>
3139N/A<synopsis>/usr/bin/pkgrepo list [-F <replaceable>format</replaceable>] [-H] [-p <replaceable>publisher</replaceable>]...
3139N/A -s <replaceable>repo_uri_or_path</replaceable> [--key <replaceable>ssl_key</replaceable> --cert <replaceable>ssl_cert</replaceable>]...
3139N/A [-t <replaceable>action_name</replaceable>[,<replaceable>action_name</replaceable>]...]... -s <replaceable>repo_uri_or_path</replaceable>
3139N/A [--key <replaceable>ssl_key</replaceable> --cert <replaceable>ssl_cert</replaceable>]... [<replaceable>pkg_fmri_pattern</replaceable>...]</synopsis>
3139N/A -s <replaceable>repo_uri_or_path</replaceable> [--key <replaceable>ssl_key</replaceable> --cert <replaceable>ssl_cert</replaceable>]...
3139N/A -s <replaceable>repo_uri_or_path</replaceable> [--key <replaceable>ssl_key</replaceable> --cert <replaceable>ssl_cert</replaceable>]...
3139N/A -s <replaceable>repo_uri_or_path</replaceable> <replaceable>pkg_fmri_pattern</replaceable> ...</synopsis>
3139N/A<synopsis>/usr/bin/pkgrepo set [-p <replaceable>publisher</replaceable>]... -s <replaceable>repo_uri_or_path</replaceable>
3139N/A <replaceable>section/property</replaceable>=[<replaceable>value</replaceable>] ...</synopsis>
3139N/A<synopsis>/usr/bin/pkgrepo set [-p <replaceable>publisher</replaceable>]... -s <replaceable>repo_uri_or_path</replaceable>
3139N/A <replaceable>section/property</replaceable>=([<replaceable>value</replaceable>]) ...</synopsis>
3356N/A<para>通过 <command>pkgrepo</command> 可以创建和管理 <literal> pkg</literal>(5) 软件包系统信息库。软件包系统信息库是一组预定义的目录和文件,允许 <command>pkg</command> 和发布客户机(例如 <command>pkgsend </command> 或 <command>pkgrecv</command>)存储和检索软件包数据。此外,当需要对软件包系统信息库进行基于网络的访问时,<command>pkg.depotd</command> 可以提供对该系统信息库的客户机访问权限,以存储和/或检索软件包数据。</para>
3139N/A<varlistentry><term><command>pkgrepo create</command> [<option>-version</option> <replaceable>ver</replaceable>] <replaceable>uri_or_path</replaceable></term>
3139N/A<varlistentry><term><command>pkgrepo add-publisher</command> <option>s</option> <replaceable>repo_uri_or_path</replaceable> <replaceable>publisher</replaceable> ...</term>
3139N/A<varlistentry><term><command>pkgrepo remove-publisher</command> [<option>n</option>] [<option>-synchronous</option>] <option>s</option> <replaceable>repo_uri_or_path</replaceable> <replaceable>publisher</replaceable> ...</term>
3139N/A<para>如果删除了缺省发布者,并且系统信息库中只剩余了一个发布者,则剩余的发布者将成为缺省发布者。系统信息库的 <literal>publisher/prefix</literal> 属性将设置为该剩余发布者。</para>
3139N/A<para>如果删除了缺省发布者,但系统信息库中剩余多个发布者,或者从系统信息库中删除了最后一个发布者,则将取消设置 <literal>publisher/prefix</literal> 属性。</para>
3139N/A<varlistentry><term><command>pkgrepo get</command> [<option>F</option> <replaceable>format</replaceable>] [<option>H</option>] [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> [<option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable>]... [<replaceable>section/property</replaceable> ...]</term>
3139N/A<para>缺省情况下,会在单独的行中显示每个属性及其值。空的 ASCII 字符串值用一对双引号 (<literal>""</literal>) 表示。ASCII 字符串值中的以下 Bourne shell 元字符以及换行符、空格符和制表符都必须使用反斜杠 (<literal>\</literal>) 进行转义:</para>
3139N/A<listitem><para>指定备用输出格式。<replaceable>format</replaceable> 的值可以是 <literal>tsv</literal>(以制表符分隔的值)、<literal>json</literal>(单行 JavaScript 对象表示法)或 <literal>json-formatted</literal>(格式易于阅读的 JavaScript 对象表示法)。</para>
3139N/A<varlistentry><term><option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable></term>
3139N/A<listitem><para>使用 <option>-key</option> 选项指定用于从 HTTPS 系统信息库进行软件包检索的客户机 SSL 密钥文件。使用 <option>-cert</option> 选项指定用于从 HTTPS 系统信息库进行软件包检索的客户机 SSL 证书文件。可以多次指定此选项对。</para>
3139N/A<listitem><para>仅显示指定属性的值,例如 <literal> publisher/prefix</literal> 或 <literal>repository/version</literal>。有关完整的属性列表,请参见 <command> set</command> 子命令。</para>
3139N/A<varlistentry><term><command>pkgrepo info</command> [<option>F</option> <replaceable>format</replaceable>] [<option>H</option>] [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> [<option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable>]...</term>
3139N/A<listitem><para>显示系统信息库已知的软件包发布者的列表。该列表包括每个发布者的软件包数量、最后一次更新发布者的软件包数据的时间以及发布者的软件包数据的状态(例如当前是否处于正在处理状态)。</para>
3139N/A<varlistentry><term><command>pkgrepo list</command> [<option>F</option> <replaceable>format</replaceable>] [<option>H</option>] [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> [<option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable>]... [<replaceable>pkg_fmri_pattern</replaceable> ...]</term>
3139N/A<listitem><para>列出 <replaceable>repo_uri_or_path</replaceable> 系统信息库中与指定 <replaceable>pkg_fmri_pattern</replaceable> 模式匹配的软件包。如果未指定任何模式,将列出系统信息库中的所有软件包。<replaceable>pkg_fmri_pattern</replaceable> 模式可以包含 <literal>?</literal> 和 <literal>*</literal> 字符作为 <literal>glob</literal>(3C) 式通配符,以匹配一个或多个软件包。</para>
3356N/A<para>在缺省输出中,第一列包含软件包发布者的名称。第二列包含软件包的名称。第三列是显示软件包状态的标志。状态列中的 <literal>o</literal> 值表示软件包已过时。状态列中的 <literal>r</literal> 值表示已重命名软件包,但格式已过时。第四列包含软件包的发行版本和分支版本。有关发行版本和分支版本的信息,请参见 <literal>pkg</literal>(5)。</para>
3139N/A<varlistentry><term><command>pkgrepo contents</command> [<option>m</option> [<option>t</option> <replaceable>action_name</replaceable>[,<replaceable>action_name</replaceable>]...]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> [<option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable>]... [<replaceable>pkg_fmri_pattern</replaceable>...]</term>
3139N/A<listitem><para>列出 <replaceable>repo_uri_or_path</replaceable> 系统信息库中的所有软件包。如果指定了 <replaceable>pkg_fmri_pattern</replaceable>,将显示系统信息库中所有匹配软件包的内容(操作属性)。</para>
3356N/A<listitem><para>仅显示指定软件包中的指定操作。可以多次指定 <option>t</option> 选项;也可以通过使用逗号分隔操作名称,将多个操作指定为一个 <option>t</option> 选项的参数。<replaceable>action_name</replaceable> 的值是 <literal>pkg</literal>(5) 手册页的“操作”中列出的操作之一,例如 <literal>file</literal>、<literal>dir</literal>、<literal>driver</literal>、<literal>depend</literal> 或 <literal>set</literal>。</para>
3139N/A<varlistentry><term><command>pkgrepo rebuild</command> [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> [<option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable>]... [<option>-no-catalog</option>] [<option>-no-index</option>]</term>
3139N/A<listitem><para>仅针对给定发布者执行操作。如果没有提供该选项或者指定了特定值 <literal>all</literal>,则对所有发布者执行操作。可以多次指定此选项。</para>
3139N/A<varlistentry><term><command>pkgrepo refresh</command> [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> [<option>-key</option> <replaceable>ssl_key</replaceable> <option>-cert</option> <replaceable>ssl_cert</replaceable>]... [<option>-no-catalog</option>] [<option>-no-index</option>] </term>
3139N/A<listitem><para>将在系统信息库中找到的所有新软件包编入目录并更新所有搜索索引。这主要供延迟的发布使用(<command>pkgsend</command> 的 <option>-no-catalog </option> 或 <option>-no-index</option> 选项)。</para>
3139N/A<listitem><para>仅针对给定发布者执行操作。如果没有提供该选项或者指定了特定值 <literal>all</literal>,则对所有发布者执行操作。可以多次指定此选项。</para>
3139N/A<varlistentry><term><command>pkgrepo remove</command> [<option>n</option>] [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> <replaceable>pkg_fmri_pattern</replaceable> ...</term>
3139N/A<listitem><para>从系统信息库中删除与指定的 <replaceable>pkg_fmri_pattern</replaceable> 模式匹配的软件包,其中包括这些软件包所引用的且未被其他任何软件包使用的所有文件。<replaceable>pkg_fmri_pattern</replaceable> 模式可以包含 <literal>?</literal> 和 <literal>*</literal> 字符作为 <literal>glob</literal>(3C) 式通配符,以匹配一个或多个软件包。</para>
3139N/A<varlistentry><term><command>pkgrepo set</command> [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> <replaceable>section/property</replaceable>=[<replaceable>value</replaceable>] ...</term><term><command>pkgrepo set</command> [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable> <replaceable>section/property</replaceable>=([<replaceable>value</replaceable>]) ...</term>
3139N/A<listitem><para>仅为给定发布者设置属性数据。如果发布者尚未存在,将添加该发布者。特殊值 <literal> all</literal> 可用于设置所有发布者的属性。</para>
3139N/A<varlistentry><term><replaceable>section</replaceable>/<replaceable>property</replaceable>=</term>
3139N/A<varlistentry><term><replaceable>section</replaceable>/<replaceable>property</replaceable>=<replaceable>value</replaceable></term>
3139N/A<varlistentry><term><replaceable>section</replaceable>/<replaceable>property</replaceable>=(<replaceable>value1</replaceable> <replaceable>value2</replaceable> <replaceable>valueN</replaceable>)</term>
3139N/A<listitem><para>代表缺省发布者名称的字符串。第一个字符必须是 a-z、A-Z 或 0-9。该字符串的剩余部分只能包含字符 0-9、-、.、a-z 以及 A-Z。该值指示存在多个发布者的软件包时或者将软件包发布到系统信息库但没有指定发布者时,应当使用的发布者。</para>
3139N/A<para>对于系统信息库第 3 版和第 4 版,可以为系统信息库中的各发布者设置以下属性。设置这些属性时应使用 <option>p</option> 选项至少指定一个发布者。</para>
3139N/A<listitem><para>字符串,代表在使用系统信息库的配置数据添加发布者时客户机应当使用的缺省别名。第一个字符必须是 a-z、A-Z 或 0-9。该字符串的剩余部分只能包含字符 0-9、-、.、a-z 以及 A-Z。</para>
3139N/A<listitem><para>用于检查证书是否已撤销的布尔值。如果此属性设置为 <literal>True</literal>,则 <command>pkgrepo verify</command> 和 <command>pkgrepo fix</command> 命令将尝试访问用于签名验证的证书中的任何 CRL 分发点,以确定证书自颁发以来是否已被撤销。缺省值为 <literal>False</literal>。此属性仅由 <command>verify</command> 和 <command>fix</command> 子命令用来验证系统信息库的内容。此属性不影响客户机设置。此值应该与相应的 <literal>pkg</literal>(1) 属性值相同。</para>
3139N/A<listitem><para>可以使用值 <literal>core</literal> 或 <literal>supplemental</literal>,表明此系统信息库中提供的软件包类型。</para>
3139N/A<para><literal>core</literal> 类型表明系统信息库包含该库中的软件包所声明的所有依赖项。<literal>core</literal> 类型主要用于操作系统的系统信息库。</para>
3139N/A<para><literal>supplemental</literal> 类型表明系统信息库包含依赖于另一个系统信息库中的软件包或要与另一个系统信息库中软件包一起使用的软件包。</para>
3139N/A<listitem><para>在验证软件包签名时必须视为证书通用名称的名称列表。此属性仅由 <command>verify</command> 和 <command>fix</command> 子命令用来验证系统信息库的内容。此属性不影响客户机设置。这些值应该与相应的 <literal>pkg</literal>(1) 属性值相同。</para>
3139N/A<listitem><para>目录的绝对路径名称,包含此系统信息库中的软件包的信任锚。如果未指定,将使用 <filename>/etc/certs/CA/</filename>。此属性仅由 <command>verify</command> 和 <command>fix</command> 子命令用来验证系统信息库的内容。此属性不影响客户机设置。此值应该与相应的 <literal>pkg</literal>(1) 属性值相同。</para>
3139N/A<varlistentry><term><command>pkgrepo verify</command> [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable></term>
3139N/A<listitem><para>文件权限</para><para>还将检查指向系统信息库的路径,确保 <literal>pkg5srv</literal> 用户可以读取系统信息库内容。对于在系统具有非全局区域时使用 <literal>svc:/application/pkg/server</literal> 服务或使用 <literal>svc:/application/pkg/system-repository</literal> 服务变为可用的系统信息库,需要进行此检查。</para>
3139N/A<listitem><para>软件包签名</para><para>基于 <literal>repository/signature-required-names</literal>、<literal>repository/trust-anchor-directory</literal> 和 <literal>repository/check-certificate-revocation</literal> 属性的值计算软件包清单签名。</para>
3139N/A<para>相应错误将发送到 <literal>stdout</literal>。如果发送任何错误,则 <command>pkgrepo</command> 命令将退出并显示非零返回代码。</para>
3139N/A<listitem><para>仅针对指定发布者执行操作。如果没有指定发布者或者指定了特定值 <literal>all</literal>,则对所有发布者执行操作。可以多次指定此选项。</para>
3139N/A<varlistentry><term><command>pkgrepo fix</command> [<option>v</option>] [<option>p</option> <replaceable>publisher</replaceable>]... <option>s</option> <replaceable>repo_uri_or_path</replaceable></term>
3139N/A<para>如果发现系统信息库错误,将自动执行系统信息库重新生成操作。如果发现任何错误,将向 <literal>stdout</literal> 发送消息,说明必须使用 <literal>pkgsend</literal>(1) 或 <literal>pkgrecv</literal>(1) 重新导入哪些软件包以便恢复系统信息库内容。</para>
3139N/A<listitem><para>仅针对指定发布者执行操作。如果没有指定发布者或者指定了特定值 <literal>all</literal>,则对所有发布者执行操作。可以多次指定此选项。</para>
3356N/A<listitem><para>显示一个用于唯一标识 <literal>pkg</literal>(5) 系统版本的字符串。由 <command>version</command> 操作生成的值不能进行排序,并且对于在不平等情况下的比较而言是不安全的。</para>
2516N/Aexample.com 5 online 2011-07-22T18:09:09.769106Z
3139N/Arepository description Local\ copy\ of\ the\ Oracle\ Solaris\ 11\ repository
3139N/A<screen>$ <userinput>pkgrepo get -s http://pkg.oracle.com/solaris/release/ -p all</userinput>
3139N/Asolaris repository description This\ repository\ serves\ the\ Oracle\
2516N/Asolaris repository mirrors (http://pkg-cdn1.oracle.com/solaris.release/)
3139N/A<screen>$ <userinput>pkgrepo set -s /my/repository publisher/prefix=example.com</userinput></screen>
3139N/A<screen>$ <userinput>pkgrepo add-publisher -s /my/repository example.com</userinput></screen>
3139N/A<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="col1" colwidth="198*" align="left" /><colspec colname="col2" colwidth="198*" align="left" /><thead>
3356N/A<para><olink targetdoc="refman" targetptr="pkg-1"><citerefentry><refentrytitle>pkg</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>、<olink targetdoc="refman" targetptr="pkgrecv-1"><citerefentry><refentrytitle>pkgrecv</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>、<olink targetdoc="refman" targetptr="pkgsend-1"><citerefentry><refentrytitle>pkgsend</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>、<olink targetdoc="refman" targetptr="pkg.depotd-1m"><citerefentry><refentrytitle>pkg.depotd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>、<olink targetdoc="refman" targetptr="pkg-5"><citerefentry><refentrytitle>pkg</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
3139N/A<para><olink targetdoc="CCOSP">《<citetitle remap="book">Copying and Creating Package Repositories in Oracle Solaris 11.2</citetitle>》</olink></para>
3139N/A<para>大多数 <command>pkgrepo</command> 操作不可用于软件包归档文件。软件包归档文件是一个文件,通常带有 <filename>.p5p</filename> 扩展名,如 <literal>pkgrecv</literal>(1) 手册页中的 <option>a</option> 选项所述。软件包归档文件包含软件包但不包含系统信息库配置。但是,<command>pkgrepo list</command>、<command>pkgrepo info</command> 和 <command>pkgrepo contents</command> 命令适用于软件包归档文件。</para>