-
Notifications
You must be signed in to change notification settings - Fork 2
/
inapt.8
153 lines (144 loc) · 5.34 KB
/
inapt.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.TH INAPT 8 "December 26, 2009"
.SH NAME
inapt \- manages installed packages with a configuration file
.SH SYNOPSIS
.B inapt
.RI [ options ] " files" ...
.SH DESCRIPTION
Inapt is a frontend to APT that installs and removes packages
according to a configuration file. This is useful primarily if a
similar set of packages must be installed on a large number of
machines. It is also allows the installed packages to be version
controlled. The configuration file syntax allows for packages to be
installed conditionally upon a set of profiles assigned to each
machine.
The input language for Inapt is declarative, so that if all desired
packages are already installed then Inapt will take no action. This
makes Inapt suitable for running regularly to inspect the system
configuration and make sure nothing is amiss. A usual approach would
be to run Inapt in a nightly cron job.
.SH OPTIONS
.TP
.B \-h, \-?, \-\-help
Display a usage message.
.TP
.B \-p, \-\-profile \fIprofile_name\fR
Enable the specified profile.
.TP
.B \-s, \-\-simulate
No action; perform a simulation of events that would occur.
.TP
.B \-t, \-\-strict
Abort the install if a package cannot be found.
.TP
.B \-\-purge
Use purge instead of remove for anything that would be removed.
.TP
.B \-o, \-\-option \fIconfig_string\fR
Set an APT configuration option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used
multiple times to set different options.
.TP
.B \-d
Enable debugging output.
.SH PROFILES
To allow the same configuration file to be used on many machines,
Inapt supports profiles. A profile is any string, such as "laptop",
"desktop", "web-server", or "firewall". Packages can be installed only
if certain profiles are selected.
You can select profiles using the --profile option on the command
line. Inapt will also automatically select the profile corresponding
to the hostname of the current machine. Finally, profiles can be
selected in the configuration file itself.
.SH INPUT
Inapt takes as input a sequence of directives. Unless otherwise noted,
the order of directives is not significant. It is an error if
directives conflict. Whitespace is also not significant, and each line
may be terminated by a Bourne shell style comment. Each directive must
be terminated by a semicolon.
.SH DIRECTIVES
The following directives are accepted by Inapt:
.TP
.B \fIconditional_expr\fR? \fBinstall\fR \fIpackage_list\fR;
Selects one or more packages to install. Inapt will not reinstall
packages that are already installed. If a conditional expression
precedes this command, the directive will be skipped if the
expression if false.
.TP
.B \fIconditional_expr\fR? \fBremove\fR \fIpackage_list\fR;
Selects one or more packages to remove. If a conditional expression
precedes this command, the directive will be skipped if the
expression if false.
.TP
.B \fIconditional_expr\fR? \fBprofiles\fR \fIprofile_name\fR \fIprofile_name\fR ...;
Selects one or more profiles. This is equivalent to passing the
--profile command line option for each named profile. If a conditional
expression precedes this command, the directive will be skipped if
the expression if false.
.TP
.B if \fIconditional_expr\fR { ... } else { ... };
The directives in the first block will be performed if the expression
is true. Otherwise, the directives in the second
block will be performed.
.TP
.B if \fIconditional_expr\fR { ... };
This is like the previous directive, except nothing is performed if
the expression is false.
.SH CONDITIONALS
A conditional expression may take any of the following forms:
.TP
.B @\fIprofile\fR
This expression is true if the named profile is selected and
false otherwise.
.LP
However, the syntax allows for more complicated
expressions, as follows:
.TP
.B @\fI!profile\fR
This expression is true if the named profile is not selected.
.TP
.B @\fIprofile\fR @\fIprofile\fR ...
This expression is true if all of named profiles are selected.
.TP
.B @\fIprofile/\fIprofile\fR...
This expression is true if any of named profiles are selected.
.TP
.B @\fIprofileA\fR/\fIprofileB\fR @\fIprofileC\fR/\fI!profileD\fR
This expression is true if at least one of profileA or profileB
is selected, and also either profileC is selected or profileD is not
selected.
.LP
In general, any conjunction of disjunctions of profiles or negated profiles may
specified using this syntax.
.SH PACKAGE LISTS
A package list is a whitespace separated list of package names.
Each package may be optionally preceded by a conditional expression.
If preceded by a conditional expression, a package is included in
the list only if the expression is true.
.SH EXAMPLES
.TP
install gcc g++ ragel;
Install some development tools.
.TP
remove bsdgames nethack-common gnome-games;
Remove some games.
.TP
@web-server install apache2-mpm-worker libapache2-mod-fcgid;
Install the Apache HTTP daemon and related modules, but only on the web server.
.TP
@!X remove xserver-xorg;
Remove the X server, but only on machines that are not supposed to have X.
.TP
profiles core;
Always select the core profile.
.TP
@workstation profiles development;
Select the development profile on all workstations.
.TP
install @X emacs22-gtk @!X emacs22-nox;
Install either emacs22-gtk or emacs22-nox, depending on whether the X profile is selected.
.SH AUTHOR
Inapt was written by Michael Spang <[email protected]>.
.SH "SEE ALSO"
.BR dpkg (1),
.BR apt-get (8),
.BR sources.list (5)