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">
16 &apt-author.jgunthorpe;
20 <!-- The last update date -->
21 <date>2012-
06-
09T00:
00:
00Z
</date>
25 <refentrytitle>apt-config
</refentrytitle>
26 <manvolnum>8</manvolnum>
27 <refmiscinfo class=
"manual">APT
</refmiscinfo>
30 <!-- Man page title -->
32 <refname>apt-config
</refname>
33 <refpurpose>APT Configuration Query program
</refpurpose>
36 &synopsis-command-apt-config;
38 <refsect1><title>Description
</title>
39 <para><command>apt-config
</command> is an internal program used by various
40 portions of the APT suite to provide consistent configurability. It accesses
41 the main configuration file
<filename>/etc/apt/apt.conf
</filename> in a
42 manner that is easy to use for scripted applications.
</para>
44 <para>Unless the
<option>-h
</option>, or
<option>--help
</option> option is
45 given, one of the commands below must be present.
49 <varlistentry><term><option>shell
</option></term>
51 shell is used to access the configuration information from a shell
52 script. It is given pairs of arguments, the first being a shell
53 variable and the second the configuration value to query. As output
54 it lists shell assignment commands for each value present.
55 In a shell script it should be used as follows:
58 <informalexample><programlisting>
60 RES=`apt-config shell OPTS MyApp::options`
62 </programlisting></informalexample>
64 <para>This will set the shell environment variable $OPTS to the value of
65 MyApp::options with a default of
<option>-f
</option>.
</para>
68 <para>The configuration item may be postfixed with a /[fdbi]. f returns
69 file names, d returns directories, b returns true or false and i returns
70 an integer. Each of the returns is normalized and verified
75 <varlistentry><term><option>dump
</option></term>
77 Just show the contents of the configuration space.
</para>
84 <refsect1><title>options
</title>
89 <term><option>--empty
</option></term>
90 <listitem><para>Include options which have an empty value. This is the default, so
91 use --no-empty to remove them from the output.
</para></listitem>
95 <term><option>--format '
<replaceable>%f
"%v
";
%n
</replaceable>'
</option></term>
96 <listitem><para>Defines the output of each config option.
%t will be replaced with its individual name,
97 %f with its full hierarchical name and
%v with its value.
98 Use uppercase letters and special characters in the value will be encoded to ensure that
99 it can e.g. be safely used in a quoted-string as defined by RFC822. Additionally
100 %n will be replaced by a newline, and
%N by a tab. A
% can be
101 printed by using
%%.
</para></listitem>
109 <refsect1><title>See Also
</title>
114 <refsect1><title>Diagnostics
</title>
115 <para><command>apt-config
</command> returns zero on normal operation, decimal
100 on error.