apt-key.8.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % aptent SYSTEM "apt.ent"> %aptent;
  5. <!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent"> %aptverbatiment;
  6. <!ENTITY % aptvendor SYSTEM "apt-vendor.ent"> %aptvendor;
  7. ]>
  8. <refentry>
  9. <refentryinfo>
  10. &apt-author.jgunthorpe;
  11. &apt-author.team;
  12. &apt-email;
  13. &apt-product;
  14. <!-- The last update date -->
  15. <date>2016-07-01T00:00:00Z</date>
  16. </refentryinfo>
  17. <refmeta>
  18. <refentrytitle>apt-key</refentrytitle>
  19. <manvolnum>8</manvolnum>
  20. <refmiscinfo class="manual">APT</refmiscinfo>
  21. </refmeta>
  22. <!-- Man page title -->
  23. <refnamediv>
  24. <refname>apt-key</refname>
  25. <refpurpose>APT key management utility</refpurpose>
  26. </refnamediv>
  27. &synopsis-command-apt-key;
  28. <refsect1><title>Description</title>
  29. <para>
  30. <command>apt-key</command> is used to manage the list of keys used
  31. by apt to authenticate packages. Packages which have been
  32. authenticated using these keys will be considered trusted.
  33. </para>
  34. <para>
  35. Note that if usage of <command>apt-key</command> is desired the additional
  36. installation of the GNU Privacy Guard suite (packaged in
  37. <package>gnupg</package>) is required. For this reason alone the programatic
  38. usage (especially in package maintainerscripts!) is strongly discouraged.
  39. Further more the output format of all commands is undefined and can and does
  40. change whenever the underlying commands change. <command>apt-key</command> will
  41. try to detect such usage and generates warnings on stderr in these cases.
  42. </para>
  43. </refsect1>
  44. <refsect1><title>Commands</title>
  45. <variablelist>
  46. <varlistentry><term><option>add</option> <option>&synopsis-param-filename;</option></term>
  47. <listitem>
  48. <para>
  49. Add a new key to the list of trusted keys.
  50. The key is read from the filename given with the parameter
  51. &synopsis-param-filename; or if the filename is <literal>-</literal>
  52. from standard input.
  53. </para>
  54. <para>
  55. It is critical that keys added manually via <command>apt-key</command> are
  56. verified to belong to the owner of the repositories they claim to be for
  57. otherwise the &apt-secure; infrastructure is completely undermined.
  58. </para>
  59. <para>
  60. Instead of using this command a keyring can be placed directly in the
  61. <filename>/etc/apt/trusted.gpg.d/</filename> directory with a descriptive name
  62. (same rules for filename apply as for &apt-conf; files) and "<literal>gpg</literal>"
  63. as file extension.
  64. </para>
  65. </listitem>
  66. </varlistentry>
  67. <varlistentry><term><option>del</option> <option>&synopsis-param-keyid;</option></term>
  68. <listitem>
  69. <para>
  70. Remove a key from the list of trusted keys.
  71. </para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry><term><option>export</option> <option>&synopsis-param-keyid;</option></term>
  75. <listitem>
  76. <para>
  77. Output the key &synopsis-param-keyid; to standard output.
  78. </para>
  79. </listitem>
  80. </varlistentry>
  81. <varlistentry><term><option>exportall</option></term>
  82. <listitem>
  83. <para>
  84. Output all trusted keys to standard output.
  85. </para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry><term><option>list</option>, <option>finger</option></term>
  89. <listitem>
  90. <para>
  91. List trusted keys with fingerprints.
  92. </para>
  93. </listitem>
  94. </varlistentry>
  95. <varlistentry><term><option>adv</option></term>
  96. <listitem>
  97. <para>
  98. Pass advanced options to gpg. With <command>adv --recv-key</command> you
  99. can e.g. download key from keyservers directly into the the trusted set of
  100. keys. Note that there are <emphasis>no</emphasis> checks performed, so it is
  101. easy to completely undermine the &apt-secure; infrastructure if used without
  102. care.
  103. </para>
  104. </listitem>
  105. </varlistentry>
  106. <varlistentry><term><option>update</option></term>
  107. <listitem>
  108. <para>
  109. Update the local keyring with the archive keyring and remove from
  110. the local keyring the archive keys which are no longer valid.
  111. The archive keyring is shipped in the <literal>archive-keyring</literal> package of your
  112. distribution, e.g. the &keyring-package; package in &keyring-distro;.
  113. </para>
  114. </listitem>
  115. </varlistentry>
  116. <varlistentry><term><option>net-update</option></term>
  117. <listitem>
  118. <para>
  119. Perform an update working similarly to the <command>update</command> command above,
  120. but get the archive keyring from a URI instead and validate it against a master key.
  121. This requires an installed &wget; and an APT build configured to have
  122. a server to fetch from and a master keyring to validate.
  123. APT in Debian does not support this command, relying on
  124. <command>update</command> instead, but Ubuntu's APT does.
  125. </para>
  126. </listitem>
  127. </varlistentry>
  128. </variablelist>
  129. </refsect1>
  130. <refsect1><title>Options</title>
  131. <para>Note that options need to be defined before the commands described in the previous section.</para>
  132. <variablelist>
  133. <varlistentry><term><option>--keyring</option> <option>&synopsis-param-filename;</option></term>
  134. <listitem><para>With this option it is possible to specify a particular keyring
  135. file the command should operate on. The default is that a command is executed
  136. on the <filename>trusted.gpg</filename> file as well as on all parts in the
  137. <filename>trusted.gpg.d</filename> directory, though <filename>trusted.gpg</filename>
  138. is the primary keyring which means that e.g. new keys are added to this one.
  139. </para></listitem>
  140. </varlistentry>
  141. </variablelist>
  142. </refsect1>
  143. <refsect1><title>Files</title>
  144. <variablelist>
  145. &file-trustedgpg;
  146. <varlistentry><term><filename>/etc/apt/trustdb.gpg</filename></term>
  147. <listitem><para>Local trust database of archive keys.</para></listitem>
  148. </varlistentry>
  149. <varlistentry><term>&keyring-filename;</term>
  150. <listitem><para>Keyring of &keyring-distro; archive trusted keys.</para></listitem>
  151. </varlistentry>
  152. <varlistentry><term>&keyring-removed-filename;</term>
  153. <listitem><para>Keyring of &keyring-distro; archive removed trusted keys.</para></listitem>
  154. </varlistentry>
  155. </variablelist>
  156. </refsect1>
  157. <refsect1><title>See Also</title>
  158. <para>
  159. &apt-get;, &apt-secure;
  160. </para>
  161. </refsect1>
  162. &manbugs;
  163. &manauthor;
  164. </refentry>