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" [
5 <!ENTITY % aptent SYSTEM
"apt.ent">
8 <!ENTITY % aptverbatiment SYSTEM
"apt-verbatim.ent">
11 <!ENTITY % aptvendor SYSTEM
"apt-vendor.ent">
18 &apt-author.jgunthorpe;
22 <!-- The last update date -->
23 <date>2012-
06-
09T00:
00:
00Z
</date>
27 <refentrytitle>apt-config
</refentrytitle>
28 <manvolnum>8</manvolnum>
29 <refmiscinfo class=
"manual">APT
</refmiscinfo>
32 <!-- Man page title -->
34 <refname>apt-config
</refname>
35 <refpurpose>APT Configuration Query program
</refpurpose>
38 &synopsis-command-apt-config;
40 <refsect1><title>Description
</title>
41 <para><command>apt-config
</command> is an internal program used by various
42 portions of the APT suite to provide consistent configurability. It accesses
43 the main configuration file
<filename>/etc/apt/apt.conf
</filename> in a
44 manner that is easy to use for scripted applications.
</para>
46 <para>Unless the
<option>-h
</option>, or
<option>--help
</option> option is
47 given, one of the commands below must be present.
51 <varlistentry><term><option>shell
</option></term>
53 shell is used to access the configuration information from a shell
54 script. It is given pairs of arguments, the first being a shell
55 variable and the second the configuration value to query. As output
56 it lists shell assignment commands for each value present.
57 In a shell script it should be used as follows:
60 <informalexample><programlisting>
62 RES=`apt-config shell OPTS MyApp::options`
64 </programlisting></informalexample>
66 <para>This will set the shell environment variable $OPTS to the value of
67 MyApp::options with a default of
<option>-f
</option>.
</para>
70 <para>The configuration item may be postfixed with a /[fdbi]. f returns
71 file names, d returns directories, b returns true or false and i returns
72 an integer. Each of the returns is normalized and verified
77 <varlistentry><term><option>dump
</option></term>
79 Just show the contents of the configuration space.
</para>
86 <refsect1><title>options
</title>
91 <term><option>--empty
</option></term>
92 <listitem><para>Include options which have an empty value. This is the default, so
93 use --no-empty to remove them from the output.
</para></listitem>
97 <term><option>--format '
<replaceable>%f
"%v
";
%n
</replaceable>'
</option></term>
98 <listitem><para>Defines the output of each config option.
%t will be replaced with its individual name,
99 %f with its full hierarchical name and
%v with its value.
100 Use uppercase letters and special characters in the value will be encoded to ensure that
101 it can e.g. be safely used in a quoted-string as defined by RFC822. Additionally
102 %n will be replaced by a newline, and
%N by a tab. A
% can be
103 printed by using
%%.
</para></listitem>
111 <refsect1><title>See Also
</title>
116 <refsect1><title>Diagnostics
</title>
117 <para><command>apt-config
</command> returns zero on normal operation, decimal
100 on error.