Tell the user when a background update completes, not when it starts
[zeroinstall/solver.git] / 0install.1
blob3a76104dec9c27dde339ee2620d00336f0b58a7a
1 .TH 0INSTALL 1 "2012" "Thomas Leonard" ""
2 .SH NAME
3 0install \(em a decentralised software installation system
5 .SH SYNOPSIS
7 .SS Downloading and running:
9 .B 0install select \fBURI\fP
11 .B 0install download \fBURI\fP
13 .B 0install run \fBURI\fP [\fBARG\fP]...
15 .B 0install update \fBURI\fP
17 .SS Applications:
19 .B 0install add \fBNAME\fP \fBURI\fP
21 .B 0install update \fBNAME\fP
23 .B 0install whatchanged \fBNAME\fP
25 .B 0install destroy \fBNAME\fP
27 .SS Other commands:
29 .B 0install config [NAME [VALUE]]
31 .B 0install import \fBFEED\fP
33 .B 0install list \fBPATTERN\fP
35 .B 0install add-feed [\fBINTERFACE\fP] \fBFEED\fP
37 .B 0install remove-feed [\fBINTERFACE\fP] \fBFEED\fP
39 .B 0install list-feeds \fBURI\fP
41 .B 0install digest \fBDIRECTORY\fP | \fBARCHIVE\fP [\fBEXTRACT\fP]
43 .SH DESCRIPTION
44 .PP
45 Zero Install is a decentralised cross-distribution software installation
46 system. Programs and libraries are identified by URIs, and there is no need
47 for a central repository. Zero Install ensures that packages cannot conflict
48 with each other and that programs can be shared between mutually untrusting
49 users. See the web-site for more information:
51 http://0install.net/
53 The simplest case is to ask 0install to run a program, given its URI. For
54 example:
56 .B 0install run http://rox.sourceforge.net/2005/interfaces/Edit
58 .PP
59 The first time you do this, details about available versions of the program are
60 downloaded and cached, along with details about any libraries it depends on.
62 Zero Install will run a solver to select the best version of each component
63 to use. For example, it will select binaries that are compatible with your
64 CPU and operating system, in your preferred language, and marked "stable" (by
65 default).
67 If $DISPLAY is set, 0install will display a window where you can confirm (or
68 change) the selected versions.
70 It will then download the corresponding archives for those versions and store
71 them in the cache too. Each package unpacks to its own directory.
73 Finally, 0install will launch the program, setting environment variables to
74 let it locate its libraries.
76 .SH GLOBAL OPTIONS
78 The first non-option argument to 0install is the particular sub-command you
79 want to perform; these are described in detail in the next section.
81 However, there are some options that apply to all operations. These are:
83 .TP
84 \fB\-c\fP, \fB\-\-console\fP
85 Never use the GUI. Normally, 0install switches to graphical mode if it needs to
86 download anything from the network (unless DISPLAY is not set).
88 .TP
89 \fB\-h\fP, \fB\-\-help\fP
90 Show the built-in help text.
92 .TP
93 \fB\-o\fP, \fB\-\-offline\fP
94 Run in off-line mode, overriding the default setting. This prevents 0install
95 from checking for updates, and from downloading updates even if it knows about
96 them.
98 .TP
99 \fB\-v\fP, \fB\-\-verbose\fP
100 More verbose output. Use twice for even more verbose output.
103 \fB\-\-with\-store=DIR\fP
104 Append a directory to the list of implementation caches. Each sub-directory
105 of DIR contains the contents of one version of a program or library.
107 .SH SUB-COMMANDS
109 .SS 0install select [OPTIONS] URI
112 Select a version of the program identified by URI, and compatible versions of
113 all of its dependencies. The information about available versions is
114 downloaded if it's not yet in the cache.
117 The URI can be an HTTP URL, such as
118 `http://site/program.xml', a local path name like `file:///path/to/program.xml',
119 or an alias like `alias:prog'.
122 For HTTP URLs, the remote file is a signed XML document. If the key is not
123 known and trusted, you will be prompted to accept it first. Local feed files
124 are not signed (any signature will be ignored). Aliases are created using
125 0alias(1).
128 You can also specify a local selections document, as created previously using
129 the \fB\-\-xml\fP option, rather than a feed. In that case, 0install simply
130 uses those versions without running the solver.
133 After selecting (but not downloading) a set of versions, the selection is
134 displayed in a human-readable format. Use \fB\-\-xml\fP to get
135 machine-readable output.
138 If a set of versions cannot be selected using the cached information, 0install
139 will check for updates first.
142 If a set of versions can be selected based on the currently-cached information,
143 but that information is getting stale, 0install will immediately return the
144 current selection and will also start a background process to check for updates.
145 The `freshness' configuration setting controls when cached information is
146 considered to be stale.
149 Options for select:
152 \fB\-\-before=VERSION\fP
153 Select a version earlier than VERSION (i.e. force the use of an old version of
154 the program). You can only restrict the version of the program itself using this
155 option, not the version of any dependencies.
158 \fB\-\-command=COMMAND\fP
159 Some programs provide multiple commands. This selects which one you want. Common
160 values are `run' (the default), `test' (used by 0test) and `compile' (used by
161 0compile). You can also use \fB\-\-command=""\fP if you don't want to run any
162 command (for example, if the package contains data rather than a program).
165 \fB\-\-message=MESSAGE\fP
166 If we show a dialog box for the download, display MESSAGE to the user to
167 explain why the download is needed.
170 \fB\-\-not\-before=VERSION\fP
171 The selected version must not be earlier than VERSION.
172 e.g. if you want to run version 2.0 or later, use \fB\-\-not\-before=2.0\fP.
175 \fB\-\-refresh\fP
176 Download a fresh copy of all used feeds before selecting. Normally, cached
177 copies will be used if available (checking for updates later, in the
178 background).
181 \fB\-\-source\fP
182 Select source code rather than a binary. This is used internally by `0compile'.
185 \fB\-\-xml\fP
186 Print the set of chosen implementations as an XML document to stdout. This can
187 be used later with the `download' and `run' sub-commands.
191 `select' returns an exit status of zero if it selected a set of versions, and
192 a status of 1 if it could not find a consistent set.
195 .SS 0install download [OPTIONS] URI
197 This behaves similarly to `0install select', except that it also downloads the
198 selected versions if they are not already cached. Unlike `select', it does not
199 print the selected versions by default.
201 All options for `select' can also be used for `download'. In addition, these
202 options are available:
205 \fB\-\-show\fP
206 Print the selected versions in a human-readable format to stdout.
209 `download' returns an exit status of zero if it selected a suitable set of
210 versions and they are now all downloaded and in the cache. It returns a
211 status of 1 otherwise.
214 .SS 0install run [OPTIONS] URI [ARGS]
217 This behaves similarly to `0install download', except that it also runs the
218 program after ensuring it is in the cache.
221 To avoid having to keep typing the full URI, use the 0alias(1) command
222 to create shortcuts to run your programs.
225 All options for `select' and `download' can also be used for `run'. In
226 addition, these options are available:
229 \fB\-m\fP, \fB\-\-main=MAIN\fP
230 Run the specified executable instead of the default. If MAIN starts with '/'
231 then the path is relative to the implementation's top-level directory,
232 whereas otherwise it is relative to the directory containing the default
233 MAIN program. For example, if the default MAIN is \fBbin/svn\fP then
234 using \fB\-\-main=svnadmin\fP will run \fB.../bin/svnadmin\fP instead.
235 This option has been largely superseded by the newer \fB\-\-command\fP option.
238 \fB\-w\fP, \fB\-\-wrapper=WRAPPER\fP
239 Instead of executing the chosen program directly, run \fBWRAPPER PROGRAM ARGS\fP.
240 This is useful for running debuggers and tracing tools on the program (rather
241 than on 0install!). Note that the wrapper is executed in the environment selected
242 by the program; hence, this mechanism cannot be used for sandboxing. See the
243 DEBUGGING section below.
246 `run' returns an exit status of 1 if the download step failed. Otherwise,
247 the exit status will be the exit status of the program being run.
249 .SS 0install update [OPTIONS] URI
252 Check for updates to the program and download them if found. This is similar to
253 \fB0install download \-\-refresh\fP, except that it prints information about
254 whether any changes were found.
257 The options are the same as for `select'.
259 .SS 0install import FEED
262 Import a feed from a local file, as if it had been downloaded from the network.
263 This is useful when testing a feed file, to avoid uploading it to a remote
264 server in order to download it again. The file must have a trusted digital
265 signature, as when fetching from the network.
268 It is also useful when installing a feed from a CD or similar. Note: to create
269 a full bundle, for archiving or distribution on CD, see 0export(1).
271 .SS 0install add-feed [INTERFACE] FEED
274 Register an additional source of implementations (versions) of a program.
277 For example, when you check out a developer version of a project, it may
278 contain an XML feed file. To add this version to the list of available
279 versions, use `add-feed' on the XML file. The file is not copied, so you don't
280 need to re-add the feed each time it is updated. You will probably also want to
281 set the `help_with_testing' configuration option to ensure that testing
282 versions are selected by default.
285 Note that if you just want to run the program, you can invoke 0install on the
286 feed file directly (without using `add-feed'). This will force the it to
287 use that version, but won't affect what happens when you run it using the URI
288 as normal. Use `add-feed' when you want to use the developer version even when
289 using the URI, or if the program is a library (and thus referenced by URI by
290 other programs).
292 .SS 0install remove-feed [INTERFACE] FEED
295 Un-register a feed, reversing the effect of `add-feed'. If INTERFACE is not
296 given, you will be prompted to choose which INTERFACE to remove it from.
298 .SS 0install list-feeds URI
301 List all extra feeds added to URI using `add-feed'.
303 .SS 0install list PATTERN
306 List all known interface (program) URIs. If a search term is given, only
307 URIs containing that string are shown (case insensitive).
309 .SS 0install config [NAME [VALUE]]
312 View or change configuration settings.
315 With no arguments, `0install config' displays all configuration settings.
316 With one argument, it displays the current value of the named setting.
317 With two arguments, it sets the setting to the given value.
319 .SS 0install digest DIRECTORY | ARCHIVE [EXTRACT]
322 Calculate the secure hash of an implementation. This is a unique "fingerprint" of
323 a directory and all the files and subdirectories it contains. When publishing a
324 program using 0install, this value must be placed in the XML file.
327 \fB\-m\fP, \fB\-\-algorithm=HASH\fP
328 Select the secure hash function to be used. Supported values are "sha1new" (the
329 default) or "sha256".
332 If an archive is given then the hash is for the directory that would be created if
333 the archive were unpacked (or the EXTRACT subdirectory of it, if one is specified).
334 See also: 0store(1)'s manifest command.
336 .SS 0install --version
337 This can be used (without any command) the get version of 0install itself:
339 .SH APPLICATIONS
341 An application provides an easy way to run a program without typing the full URL
342 each time.
344 .SS 0install add NAME URI
347 Creates a new application called \fBNAME\fP (which can be whatever you want) to run
348 the program \fBURI\fP. A directory (by default, ~/.config/0install.net/apps/NAME) is
349 created to record the current selections, as would be produced by "0install
350 select --xml URI".
353 A launcher command (also called \fBNAME\fP) will be created in $PATH to provide
354 an easy way to run the application. For example, to add and run ROX-Filer:
356 .B $ 0install add rox http://rox.sourceforge.net/2005/interfaces/ROX-Filer
358 .B $ rox
361 If additional requirements are given (as for "0install select", e.g. --before), they
362 are stored with the application and apply to all updates.
364 .SS 0install update NAME
367 The feeds used to make the selections are updated and a new set of selections
368 is generated and saved into the application's directory. Even if you don't run
369 this command explicitly, 0install will check for updates if you run the program
370 and it hasn't been updated for a while. This happens in the background and does
371 not delay starting the program.
374 If additional requirements are given (as for "0install select", e.g. --before),
375 they update the requirements stored with the application and apply to this and
376 future updates.
378 .B 0install whatchanged \fBNAME\fP
381 Show the differences between the current and previous selections for this
382 application. Various times may also be displayed: "Last checked" is the last
383 time we successfully checked for updates (even if none was found), "Last
384 attempted update" is the last time we tried to check for updates, and "Last
385 update" is the last time changes were found. If "Last attempted update" is
386 shown, then either the last updated failed or an update is currently in
387 progress.
390 By default, only changes that resulted in a different version being selected
391 are shown. To see all changes, use \-\-full. Note that at most one set of
392 selections is saved per day.
394 .SS 0install destroy NAME
395 The application \fBNAME\fP is deleted, along with any launchers added for it.
397 .SH DEBUGGING TIPS
400 To debug 0install itself, use the \-\-verbose and \-\-console options. For
401 example:
403 .B $ 0install \-vvc run http://myprog
406 To trace or debug programs run by 0install, use the \-\-wrapper option.
407 For example, to run \fBmyprog \-\-help\fP, displaying all calls to open(2):
409 .B $ 0install run \-\-wrapper="strace \-e open" http://myprog \-\-help
411 If your program is interpreted (e.g. a Python program), and you wish to debug
412 the interpreter running it, you can do it like this:
414 .B $ 0install run \-\-wrapper="gdb \-\-args python" http://myprog \-\-help
416 .SH FILES
418 Configuration files (see freedesktop.org basedir spec):
420 .IP "~/.config/0install.net/injector/global"
421 Global configuration settings.
423 .IP "~/.config/0install.net/injector/trustdb.xml"
424 List of trusted keys.
426 .IP "~/.config/0install.net/injector/feeds"
427 Per-feed information (e.g. time of last check).
429 .IP "~/.config/0install.net/injector/interfaces"
430 Per-interface settings (preferred stability and any extra feeds that have been
431 registered).
434 Cached data (can be re-downloaded if lost):
436 .IP "~/.cache/0install.net/interfaces"
437 Downloaded cached feed files.
439 .IP "~/.cache/0install.net/implementations"
440 Downloaded cached implementations, indexed by manifest digest.
443 See the 0store(1) man page for more information.
445 .SH ENVIRONMENT VARIABLES
447 .IP XDG_*
448 The configuration and cache directories can be changed using \fBXDG_CONFIG_HOME\fP,
449 \fBXDG_CONFIG_DIRS\fP, \fBXDG_CACHE_HOME\fP and \fBXDG_CACHE_DIRS\fP, as usual.
451 .IP ZEROINSTALL_PORTABLE_BASE
453 If this is set, then the XDG_ variables are ignored and the configuration and cache are stored in \fB$ZEROINSTALL_PORTABLE_BASE/config\fP and \fB$ZEROINSTALL_PORTABLE_BASE/cache\fP instead.
455 .IP ZEROINSTALL_EXTERNAL_STORE
457 When 0install wants to add an archive to the cache, it calls this program instead of doing it itself. This is used internally on Windows to connect to some .NET code. It may change in future.
459 .SH LICENSE
461 Copyright (C) 2012 Thomas Leonard.
464 You may redistribute copies of this program under the terms of the GNU Lesser General Public License.
465 .SH BUGS
467 Please report bugs to the developer mailing list:
469 http://0install.net/support.html
471 .SH AUTHOR
473 Zero Install was created by Thomas Leonard, with help from many others. See the Git log for details.
475 .SH SEE ALSO
476 0alias(1), 0store(1), 0launch(1)
478 The Zero Install web-site:
480 .B http://0install.net