neulab/tldr huggingface dataset:
num_exp     ::= operand ⎪ operand ('+'⎪'-'⎪'*'⎪'/'⎪'%') num_exp
operand     ::= ('+'⎪'-')? NUMBER ⎪ INDEX_MARK ⎪ '(' num_exp ')' ⎪ variable
loop_limits ::= DELIM_OPEN (num_exp)? ',' (num_exp)? (',' (num_exp)?)? DELIM_CLOSE
NUMBER      ::= ('0'⎪...⎪'9')+
TEXT_PATTERN::= (^('/'))+ TEXT_SUBST  ::= (^(DELIM_INIT⎪'/'))+ TEXT_ARGS   ::= (^(DELIM_INIT⎪')'))+ TEXT_EXP    ::= (^(DELIM_INIT⎪DELIM_CLOSE⎪':'))+ TEXT        ::= (^(DELIM_INIT⎪INDEX_OPEN⎪INDEX_CLOSE))+
DELIM_INIT  ::= '$' DELIM_OPEN  ::= '{' DELIM_CLOSE ::= '}' INDEX_OPEN  ::= '[' INDEX_CLOSE ::= ']' INDEX_MARK  ::= '#' NAME_CHARS  ::= 'a'⎪...⎪'z'⎪'A'⎪...⎪'Z'⎪'0'⎪...⎪'9'
Notice that the grammar definitions of DELIM_INIT, DELIM_OPEN, DELIM_CLOSE, INDEX_OPEN, INDEX_CLOSE, INDEX_MARK and NAME_CHARS correspond to the default syntax configuration only. They can be changed through the API (see var_syntax_t).
APPLICATION PROGRAMMING INTERFACE (API) The following is a detailed description of the OSSP var ISO-C language Application Programming Interface (API):
TYPES
The OSSP var API consists of the following ISO-C data types:
var_rc_t This is an exported enumerated integer type describing the return code of all API functions. On success, every API function returns "VAR_OK". On error, it returns "VAR_ERR_XXX". For a list of all possible return codes see var.h. Their corresponding describing text can be determined with function var_strerror.
var_t This is an opaque data type representing a variable expansion context.  Only pointers to this abstract data type are used in the API.
var_config_t This is an exported enumerated integer type describing configuration parameters for function var_config. Currently "VAR_CONFIG_SYNTAX" for configuring the syntax via var_syntax_t, "VAR_CONFIG_CB_VALUE" for configuring the callback for value lookups via var_cb_value_t, and "VAR_CONFIG_CB_OPERATION" for configuring the callback for custom value operation functions via var_cb_operation_t are defined.
var_syntax_t This is an exported structural data type describing the variable construct syntax. It is passed to var_config on "VAR_CONFIG_SYNTAX" and consists of the following members (directly corresponding to the upper-case non-terminals in the grammar above):
char  escape;       /* default: '\\' */ char  delim_init;   /* default: '$' */ char  delim_open;   /* default: '{' */ char  delim_close;  /* default: '}' */ char  index_open;   /* default: '[' */ char  index_close;  /* default: ']' */ char  index_mark;   /* default: '#' */ char *name_chars;   /* default: "a-zA-Z0-9_" */
All members are single character constants, except for name_chars which is a character class listing all valid characters. As an abbreviation the construct "x"-"y" is supported which means all characters from x to y (both included) in the underlying character set.
var_cb_value_t This is an exported function pointer type for variable value lookup functions. Such a callback function cb has to be of the following prototype:
var_rc_t *cb(var_t *var, void *ctx, const char *var_ptr, size_t var_len, int var_idx, const char **val_ptr, size_t *val_len, size_t *val_size);
This function will be called by var_expand internally whenever it has to resolve the contents of a variable. Its parameters are:
var_t *var This is the passed-through argument as passed to var_expand as the first argument. This can be used in the callback function to distinguish the expansion context or to resolve return codes, etc.
void *ctx This is the passed-through argument as passed to var_config on "VAR_CONFIG_CB_VALUE" as the forth argument. This can be used to provide an internal context to the callback function through var_expand.
const char *var_ptr This is a pointer to the name of the variable whose contents var_expand wishes to resolve. Please note that the string is NOT necessarily terminated by a "NUL" ('"\0"') character. If the callback function needs it "NUL"-terminated, it has to copy the string into an a temporary buffer of its own and "NUL"-terminate it there.
size_t var_len This is the length of the variable name at var_ptr.
int var_idx This determines which entry of an array variable to lookup. If the variable specification that led to the execution of the lookup function did not contain an index, zero (0) is provided by default as var_idx. If var_idx is less than zero, the callback should return the number of entries in the array variable. If var_idx is greater or equal zero, it should return the specified particular entry. It is up to the callback to decide what to return for an index not equal to zero if the underlying variable is a scalar.
const char **val_ptr This is a pointer to the location where the callback function should store the pointer to the resolved value of the variable.
size_t *val_len This is a pointer to the location where the callback function should store the length of the resolved value of the variable.
size_t *val_size This is a pointer to the location where the callback function should store the size of the buffer that has been allocated to hold the value of the resolved variable.
If no buffer has been allocated by the callback at all, because the variable uses some other means of storing the contents -- as in the case of getenv(3), where the system provides the buffer for the string --, this should be set to zero (0).
In case a buffer size greater than zero is returned by the callback, var_expand will make use of that buffer internally if possible. It will also free(3) the buffer when it is not needed anymore, so it is important that it was previously allocated with malloc(3) by the callback.
The return code of the lookup function cb is interpreted by var_expand according to the following convention: "VAR_OK" means success, that is, the contents of the variable has been resolved successfully and the val_ptr, val_len, and val_size variables have been filled with appropriate values. A return code "VAR_ERR_XXX" means that the resolving failed, such as a system error or lack of resources. In the latter two cases, the contents of val_ptr, val_len and val_size is assumed to be undefined. Hence, var_expand will not free(3) any possibly allocated buffers, the callback must take care of this itself.
If a callback returns the special "VAR_ERR_UNDEFINED_VARIABLE" return code, the behavior of var_expand depends on the setting of its force_expand parameter. If force_expand has been set, var_expand will pass-through this error to the caller. If force_expand has not been set, var_expand will copy the expression that caused the lookup to fail verbatim into the output buffer so that an additional expanding pass may expand it later.
If the callback returns an "VAR_ERR_XXX", var_expand will fail with this return code. If the cause for the error can not be denoted by an error code defined in var.h, callback implementors should use the error code "VAR_ERR_CALLBACK" (which is currently defined to -64). It is guaranteed that no error code smaller than "VAR_ERR_CALLBACK" is ever used by any OSSP var API function, so if the callback implementor wishes to distinguish between different reasons for failure, he subtract own callback return codes from this value, i.e., return ("VAR_ERR_CALLBACK" - n) (n >= 0) from the callback function.
var_cb_operation_t This is an exported function pointer type for variable value operation functions. Such a callback function cb has to be of the following prototype:
var_rc_t *cb(var_t *var, void *ctx, const char *op_ptr, size_t op_len, const char *arg_ptr, size_t arg_len, const char *val_ptr, size_t val_len, const char **out_ptr, size_t *out_len, size_t *out_size);
This function will be called by var_expand internally whenever a custom operation is used. Its parameters are:
void *ctx This is the passed-through argument as passed to var_config on "VAR_CONFIG_CB_OPERATION" as the forth argument. This can be used to provide an internal context to the callback function through var_expand.
const char *op_ptr This is a pointer to the name of the operation which var_expand wishes to perform. Please note that the string is NOT necessarily terminated by a "NUL" ('"\0"') character. If the callback function needs it "NUL"-terminated, it has to copy the string into an a temporary buffer of its own and "NUL"-terminate it there.
size_t op_len This is the length of the variable name at op_ptr.
const char *arg_ptr This is a pointer to the optional argument string to the operation. If no argument string or an empty argument string was supplied this is "NULL".
size_t arg_len This is the length of the arg_ptr.
const char *val_ptr This is a pointer to the value of the variable which the operation wants to adjust.
size_t val_len This is the length of the val_ptr.
const char **out_ptr This is a pointer to the location where the callback function should store the pointer to the adjusted value.
size_t *out_len This is a pointer to the location where the callback function should store the length of the adjusted value of the variable.
size_t *out_size This is a pointer to the location where the callback function should store the size of the buffer that has been allocated to hold the adjusted value of the variable.
If no buffer has been allocated by the callback at all, because the variable uses some other means of storing the contents, this should be set to zero (0).
The OSSP var API consists of the following ISO-C functions:
var_rc_t var_create(var_t **var); Create a new variable expansion context and store it into var.
var_rc_t var_destroy(var_t *var); Destroy the variable expansion context var.
var_rc_t var_config(var_t *var, var_config_t mode, ...); Configure the variable expansion context var. The variable argument list depends on the mode identifier:
"VAR_CONFIG_SYNTAX", var_syntax_t *syntax This overrides the syntax configuration in var with the one provided in syntax. The complete structure contents is copied, so the caller is allowed to immediately destroy syntax after the var_config call.  The default is the contents as shown above under the type description of var_syntax_t.
"VAR_CONFIG_CB_VALUE", var_cb_value_t cb, void *ctx This overrides the value expansion in var. The default is "NULL" for cb and ctx. At least "NULL" for cb is not valid for proper operation of var_expand, so the caller has to configure the callback before variable expansions can be successfully performed.
"VAR_CONFIG_CB_OPERATION", var_cb_operation_t cb, void *ctx This provides a custom value operation function for var. The default is "NULL" for cb and ctx which means no custom operation is available.
var_rc_t var_unescape(var_t *var, const char *src_ptr, size_t src_len, char *dst_ptr, size_t  dst_len, int all); This expands escape sequences found in the input buffer src_ptr/src_len. The dst_ptr/dst_len point to a output buffer, into which the expanded data is copied if processing is successful. The size of this buffer must be at least src_len+1 characters. The reason is that var_unescape always adds a terminating "NUL" ('"\0"') character at the end of the output buffer, so that you can use the result comfortably with other C library routines. The supplied dst_ptr either has to point to a pre-allocated buffer or is allowed to point to src_ptr (because the unescaping operation is guaranteed to either keep the size or reduce the size of the input).
The parameter all is a boolean flag that modifies the behavior of var_unescape. If is set to true (any value except zero), var_unescape will expand any escape sequences it sees, even those that it does not know about. This means that ""\1"" will become "1", even though ""\1"" has no special meaning to var_unescape. If all is set to false (the value zero), such escape sequences will be copied verbatim to the output buffer.
The quoted pairs supported by var_unescape are ""\t"" (tabulator), ""\r"" (carriage return), ""\n"" (line feed), ""\NNN"" (octal value), ""\xNN"" (hexadecimal value), and ""\x{NNMM..}"" (grouped hexadecimal values).
var_rc_t var_expand(var_t *var, const char *src_ptr, size_t src_len, char **dst_ptr, size_t *dst_len, int force_expand); This is the heart of OSSP var. It expands all syntax constructs in src_ptr/src_len and stores them in an allocated buffer returned in dst_ptr/dst_len.
The output buffer dst_ptr/dst_len is allocated by var_expand using the system call malloc(3), thus it is the caller's responsibility to free(3) that buffer once it is no longer used anymore. The output buffer for convenience reasons is always "NUL"-terminated by var_expand, but this "NUL" character is not counted for dst_len.  The dst_len pointer can be specified as "NULL" if you are not interested in the output buffer length.
The force_expand flag determines how var_expand deals with undefined variables (indicated by the callback function through the return code "VAR_ERR_UNDEFINED_VARIABLE"). If it is set to true (any value except zero), var_expand will fail with error code "VAR_ERR_UNDEFINED_VARIABLE" whenever an undefined variable is encountered. That is, it just passes-through the return code of the callback function. If set to false (value zero), var_expand will copy the expression it failed to expand verbatim into the output buffer, in order to enable you to go over the buffer with an additional pass. Generally, if you do not plan to use multi-pass expansion, you should set force_expand to true in order to make sure no unexpanded variable constructs are left over in the buffer.
If var_expand fails with an error, dst_ptr will point to src_ptr and dst_len will contain the number of characters that have been consumed from src_ptr before the error occurred. In other words, if an error occurs, dst_ptr/dst_len point to the last parsing location in src_ptr/src_len before the error occurred. The only exceptions for this error semantics are: on "VAR_ERR_INVALID_ARGUMENT" and "VAR_ERR_OUT_OF_MEMORY" errors, dst_ptr and dst_len are undefined.
var_rc_t var_formatv(var_t *var, char **dst_ptr, int force_expand, const char *fmt, va_list ap); This is a high-level function on top of var_expand which expands simple printf(3)-style constructs before expanding the complex variable constructs. So, this is something of a combination between sprintf(3) and var_expand.
It expands simple "%s" (string, type ""char *""), "%d" (integer number, type ""int"") and "%c" (character, type ""int"") constructs in fmt. The values are taken from the variable argument vector ap. After this expansion the result is passed through var_expand by passing through the var, dst_ptr and force_expand arguments.  The final result is a malloc(3)'ed buffer provided in dst_ptr which the caller has to free(3) later.
var_rc_t var_format(var_t *var, char **dst_ptr, int force_expand, const char *fmt, ...); This is just a wrapper around var_formatv which translates the variable argument list into "va_list".
var_rc_t var_strerror(var_t *var, var_rc_t rc, char **str); This can be used to map any var_rc_t return codes (as returned by all the OSSP var API functions) into a clear-text message describing the reason for failure in prose. Please note that errors coming from the callback, such as "VAR_ERR_CALLBACK" and those based on it, cannot be mapped and will yield the message ""unknown error"".
The OSSP var API consists of the following ISO-C exported variables:
var_id This is just a pointer to the constant string ""OSSP var"". It is used as the first argument in ex_trow calls if OSSP var is built with OSSP ex support. It then allows the application to determine whether a caught exception was thrown by OSSP var. See EXCEPTION HANDLING below for more details.
For maximum power and flexibility, you usually want to combine var_unescape and var_expand. That is, you will want to use var_unescape to turn all escape sequences into their real representation before you call var_expand for expanding variable constructs. This way the user can safely use specials like ""\n"" or ""\t"" throughout the template and achieve the desired effect. These escape sequences are particularly useful if search-and-replace or transpose actions are performed on variables before they are expanded.  Be sure, though, to make the first var_unescape pass with the all flag set to false, or the routine will also expand escape sequences like ""\1"", which might have a special meaning (regular expression back-references) in the var_expand pass to follow.
Once all known escape sequences are expanded, expand the variables with var_expand. After that, you will want to have a second pass with var_unescape and the flag all set to true, to make sure all remaining escape sequences are expanded. Also, the var_expand pass might have introduced now quoted pairs into the output text, which you need to expand to get the desired effect.
OSSP var can be optionally built with support for exception handling via OSSP ex (see http://www.ossp.org/pkg/lib/ex/). For this it has to be configured with the GNU Autoconf option "--with-ex". The difference then is that the OSSP var API functions throw exceptions instead of returning "VAR_ERR_XXX" return codes.
The thrown exceptions can be identified as OSSP var exceptions by checking the exception attribute ex_class. It is the OSSP var API symbol var_id for all OSSP var exceptions. The ex_object attribute is always "NULL". The ex_value attribute is the var_rc_t which forced the throwing of the exception.
Exception throwing can be suppressed with ex_shield only.
EXAMPLE (DEVELOPER) The following simple but complete program illustrates the full usage of OSSP var. It accepts a single argument on the command line and expands this in three steps (unescaping known escape sequences, expanding variable constructs, unescaping new and unknown escape sequences). The value lookup callback uses the process environment to resolve variables.
#include <stdio.h> #include <stdlib.h> #include <string.h>
#include "var.h"
static var_rc_t lookup( var_t *var, void *ctx, const char  *var_ptr, size_t  var_len, int     var_idx, const char **val_ptr, size_t *val_len, size_t *val_size) { char tmp[256];
if (var_idx != 0) return VAR_ERR_ARRAY_LOOKUPS_ARE_UNSUPPORTED; if (var_len > sizeof(tmp) - 1) return VAR_ERR_OUT_OF_MEMORY; memcpy(tmp, var_ptr, var_len); tmp[var_len] = '\0'; if ((*val_ptr = getenv(tmp)) == NULL) return VAR_ERR_UNDEFINED_VARIABLE; *val_len = strlen(*val_ptr); *val_size = 0; return VAR_OK; }
static void die(const char *context, var_t *var, var_rc_t rc) { char *error;
var_strerror(var, rc, &error); fprintf(stderr, "ERROR: %s: %s (%d)\n", context, error, rc); exit(1); }
int main(int argc, char *argv[]) { var_t *var; var_rc_t rc; char *src_ptr; char *dst_ptr; size_t src_len; size_t dst_len; var_syntax_t syntax = { '\\', '$', '{', '}', '[', ']', '#', "a-zA-Z0-9_" };
/* command line handling */ if (argc != 2) die("command line", NULL, VAR_ERR_INVALID_ARGUMENT); src_ptr = argv[1]; src_len = strlen(src_ptr); fprintf(stdout, "input:     \"%s\"\n", src_ptr);
/* establish variable expansion context */ if ((rc = var_create(&var)) != VAR_OK) die("create context", NULL, rc); if ((rc = var_config(var, VAR_CONFIG_SYNTAX, &syntax)) != VAR_OK) die("configure syntax", var, rc); if ((rc = var_config(var, VAR_CONFIG_CB_VALUE, lookup, NULL)) != VAR_OK) die("configure callback", var, rc);
/* unescape known escape sequences (in place) */ if ((rc = var_unescape(var, src_ptr, src_len, src_ptr, src_len+1, 0)) != VAR_OK) die("unescape known escape sequences", var, rc); src_len = strlen(src_ptr); fprintf(stdout, "unescaped: \"%s\"\n", src_ptr);
/* expand variable constructs (force expansion) */ if ((rc = var_expand(var, src_ptr, src_len, &dst_ptr, &dst_len, 1)) != VAR_OK) { if (rc != VAR_ERR_INVALID_ARGUMENT && rc != VAR_ERR_OUT_OF_MEMORY) { fprintf(stdout, "parsing:   \"%s\"\n", dst_ptr); fprintf(stdout, "             %*s\n", dst_len, "^"); } die("variable expansion", var, rc); } fprintf(stdout, "expanded:  \"%s\"\n", dst_ptr);
/* unescape new and unknown escape sequences (in place) */ if ((rc = var_unescape(var, dst_ptr, dst_len, dst_ptr, dst_len+1, 1)) != VAR_OK) die("unescape new and unknown escape sequences", var, rc); fprintf(stdout, "output:    \"%s\"\n", dst_ptr); free(dst_ptr);
/* destroy variable expansion context */ if ((rc = var_destroy(var)) != VAR_OK) die("destroy context", var, rc);
return 0; }
Copy & paste the source code into a file var_play.c (or use the version already shipped with the OSSP var source distribution), compile it with
$ cc `var-config --cflags` \ -o var_play var_play.c \ `var-config --ldflags --libs`
and use it to play with the various OSSP var variable expansion possibilities.
EXAMPLE (USER) The following are a few sample use cases of OSSP var variable expansions. They all assume the default syntax configuration and the following variable definitions: "$foo=foo" (a scalar), "$bar=<bar1,bar2,bar3,>" (an array), "$baz=<baz1,baz2,baz3,>" (another array), "$quux=quux" (another scalar), "$name=<foo,bar,baz,quux>" (another scalar) and "$empty=""" (another scalar).
Input                         Output ----------------------------- -------------- $foo                          foo ${foo}                        foo ${bar[0]}                     bar1 ${${name[1]}[0]}              bar1 ${foo:u:y/O/U/:s/(.*)/<\1>/}  <FUU> ${foo:u:y/O/U/:s/(.*)/<\1>/}  <FUU> ${empty:-foo}                 foo ${foo:+yes}${foo:*no}         yes ${empty:+yes}${empty:*no}     no ${foo:p/6/./l}                foo... ${foo:p/6/./r}                ...foo [${bar[#]}${bar[#+1]:+,}]     bar1,bar2,bar3 [${bar[#-1]:+,}${bar[#]}]     bar1,bar2,bar3 [${bar[#]}]{2,1,3}            bar2bar3 [${bar[#]}]{1,2,3}            bar1bar3 [${foo[#]}[${bar[#]}]]{1,,2}  foo1bar1bar2bar3foo2bar1bar2bar3
pcre(3), regex(7), OSSP val (Value Access), OSSP ex (Exception Handling).
OSSP var was initially written by Peter Simons <simons@crypt.to> in November 2001 under contract with the OSSP sponsor Cable & Wireless. Its API and internal code structure was revamped in February 2002 by Ralf S. Engelschall <rse@engelschall.com> to fully conform to the OSSP library standards. Before its initial public release, Ralf S. Engelschall in March 2002 finally added support for custom operations, the formatting functionality, optional multi-line matching, etc.
APT-GET(8)                             APT                            APT-GET(8)
apt-get - APT package handling utility -- command-line interface
apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture] {update | upgrade | dselect-upgrade | dist-upgrade | install pkg [{=pkg_version_number | /target_release}]...  | remove pkg...  | purge pkg...  | source pkg [{=pkg_version_number | /target_release}]...  | build-dep pkg [{=pkg_version_number | /target_release}]...  | download pkg [{=pkg_version_number | /target_release}]...  | check | clean | autoclean | autoremove | {-v | --version} | {-h | --help}}
apt-get is the command-line tool for handling packages, and may be considered the user's "back-end" to other tools using the APT library. Several "front-end" interfaces exist, such as aptitude(8), synaptic(8) and wajig(1).
update update is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this command retrieves and scans the Packages.gz files, so that information about new and updated packages is available. An update should always be performed before an upgrade or dist-upgrade. Please be aware that the overall progress meter will be incorrect as the size of the package files cannot be known in advance.
upgrade upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first so that apt-get knows that new versions of packages are available.
dist-upgrade dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.
dselect-upgrade dselect-upgrade is used in conjunction with the traditional Debian packaging front-end, dselect(1).  dselect-upgrade follows the changes made by dselect(1) to the Status field of available packages, and performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages).
install install is followed by one or more packages desired for installation or upgrading. Each package is a package name, not a fully qualified filename (for instance, in a Debian system, apt-utils would be the argument provided, not apt-utils_2.3.13_amd64.deb). All packages required by the package(s) specified for installation will also be retrieved and installed. The /etc/apt/sources.list file is used to locate the desired packages. If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed. Similarly a plus sign can be used to designate a package to install. These latter features may be used to override decisions made by apt-get's conflict resolution system.
A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, testing, unstable).
Both of the version selection mechanisms can downgrade packages and must be used with care.
This is also the target to use if you want to upgrade one or more already-installed packages without upgrading every package you have on your system. Unlike the "upgrade" target, which installs the newest version of all currently installed packages, "install" will install the newest version of only the package(s) specified. Simply provide the name of the package(s) you wish to upgrade, and if a newer version is available, it (and its dependencies, as described above) will be downloaded and installed.
Finally, the apt_preferences(5) mechanism allows you to create an alternative installation policy for individual packages.
If no package matches the given expression and the expression contains one of '.', '?' or '*' then it is assumed to be a POSIX regular expression, and it is applied to all package names in the database. Any matches are then installed (or removed). Note that matching is done by substring so 'lo.*' matches 'how-lo' and 'lowest'. If this is undesired, anchor the regular expression with a '^' or '$' character, or create a more specific regular expression.
Fallback to regular expressions is deprecated in APT 2.0, has been removed in apt(8), except for anchored expressions, and will be removed from apt-get(8) in a future version. Use apt-patterns(5) instead.
reinstall reinstall is an alias for install --reinstall.
remove remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.
purge purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).
source source causes apt-get to fetch source packages. APT will examine the available packages to decide which source package to fetch. It will then find and download into the current directory the newest available version of that source package while respecting the default release, set with the option APT::Default-Release, the -t option or per package with the pkg/release syntax, if possible.
The arguments are interpreted as binary and source package names. See the --only-source option if you want to change that.
Source packages are tracked separately from binary packages via deb-src lines in the sources.list(5) file. This means that you will need to add such a line for each repository you want to get sources from; otherwise you will probably get either the wrong (too old/too new) source versions or none at all.
If the --compile option is specified then the package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the --host-architecture option. If --download-only is specified then the source package will not be unpacked.
A specific source version can be retrieved by postfixing the source name with an equals and then the version to fetch, similar to the mechanism used for the package files. This enables exact matching of the source package name and version, implicitly enabling the APT::Get::Only-Source option.
Note that source packages are not installed and tracked in the dpkg database like binary packages; they are simply downloaded to the current directory, like source tarballs.
build-dep build-dep causes apt-get to install/remove packages in an attempt to satisfy the build dependencies for a source package. By default the dependencies are satisfied to build the package natively. If desired a host-architecture can be specified with the --host-architecture option instead.
The arguments are interpreted as binary or source package names. See the --only-source option if you want to change that.
satisfy satisfy causes apt-get to satisfy the given dependency strings. The dependency strings may have build profiles and architecture restriction list as in build dependencies. They may optionally be prefixed with "Conflicts: " to unsatisfy the dependency string. Multiple strings of the same type can be specified.
Example: apt-get satisfy "foo" "Conflicts: bar" "baz (>> 1.0) | bar (= 2.0), moo"
The legacy operator '</>' is not supported, use '<=/>=' instead.
check check is a diagnostic tool; it updates the package cache and checks for broken dependencies.
download download will download the given binary package into the current directory.
clean clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
autoclean (and the auto-clean alias since 1.1) Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to be maintained over a long period without it growing out of control. The configuration option APT::Clean-Installed will prevent installed packages from being erased if it is set to off.
autoremove (and the auto-remove alias since 1.1) autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
changelog changelog tries to download the changelog of a package and displays it through sensible-pager. By default it displays the changelog for the version that is installed. However, you can specify the same options as for the install command.
indextargets Displays by default a deb822 formatted listing of information about all data files (aka index targets) apt-get update would download. Supports a --format option to modify the output format as well as accepts lines of the default output to filter the records by. The command is mainly used as an interface for external tools working with APT to get information as well as filenames for downloaded files so they can use them as well instead of downloading them again on their own. Detailed documentation is omitted here and can instead be found in the file /usr/share/doc/apt/acquire-additional-files.md.gz shipped by the apt-doc package.
--no-install-recommends Do not consider recommended packages as a dependency for installing. Configuration Item: APT::Install-Recommends.
--install-suggests Consider suggested packages as a dependency for installing. Configuration Item: APT::Install-Suggests.
-d, --download-only Download only; package files are only retrieved, not unpacked or installed. Configuration Item: APT::Get::Download-Only.
-f, --fix-broken Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention (which usually means using dpkg --remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken.
-m, --ignore-missing, --fix-missing Ignore missing packages; if packages cannot be retrieved or fail the integrity check after retrieval (corrupted package files), hold back those packages and handle the result. Use of this option together with -f may produce an error in some situations. If a package is selected for installation (particularly if it is mentioned on the command line) and it could not be downloaded then it will be silently held back. Configuration Item: APT::Get::Fix-Missing.
--no-download Disables downloading of packages. This is best used with --ignore-missing to force APT to use only the .debs it has already downloaded. Configuration Item: APT::Get::Download.
-q, --quiet Quiet; produces output suitable for logging, omitting progress indicators. More q's will produce more quiet up to a maximum of 2. You can also use -q=# to set the quiet level, overriding the configuration file. Note that quiet level 2 implies -y; you should never use -qq without a no-action modifier such as -d, --print-uris or -s as APT may decide to do something you did not expect. Configuration Item: quiet.
-s, --simulate, --just-print, --dry-run, --recon, --no-act No action; perform a simulation of events that would occur based on the current system state but do not actually change the system. Locking will be disabled (Debug::NoLocking) so the system state could change while apt-get is running. Simulations can also be executed by non-root users which might not have read access to all apt configuration distorting the simulation. A notice expressing this warning is also shown by default for non-root users (APT::Get::Show-User-Simulation-Note). Configuration Item: APT::Get::Simulate.
Simulated runs print out a series of lines, each representing a dpkg operation: configure (Conf), remove (Remv) or unpack (Inst). Square brackets indicate broken packages, and empty square brackets indicate breaks that are of no consequence (rare).
-y, --yes, --assume-yes Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package, trying to install an unauthenticated package or removing an essential package occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.
--assume-no Automatic "no" to all prompts. Configuration Item: APT::Get::Assume-No.
--no-show-upgraded Do not show a list of all packages that are to be upgraded. Configuration Item: APT::Get::Show-Upgraded.
-V, --verbose-versions Show full versions for upgraded and installed packages. Configuration Item: APT::Get::Show-Versions.
-a, --host-architecture This option controls the architecture packages are built for by apt-get source --compile and how cross-builddependencies are satisfied. By default is it not set which means that the host architecture is the same as the build architecture (which is defined by APT::Architecture). Configuration Item: APT::Get::Host-Architecture.
-P, --build-profiles This option controls the activated build profiles for which a source package is built by apt-get source --compile and how build dependencies are satisfied. By default no build profile is active. More than one build profile can be activated at a time by concatenating them with a comma. Configuration Item: APT::Build-Profiles.
-b, --compile, --build Compile source packages after downloading them. Configuration Item: APT::Get::Compile.
--ignore-hold Ignore package holds; this causes apt-get to ignore a hold placed on a package. This may be useful in conjunction with dist-upgrade to override a large number of undesired holds. Configuration Item: APT::Ignore-Hold.
--with-new-pkgs Allow installing new packages when used in conjunction with upgrade. This is useful if the update of an installed package requires new dependencies to be installed. Instead of holding the package back upgrade will upgrade the package and install the new dependencies. Note that upgrade with this option will never remove packages, only allow adding new ones. Configuration Item: APT::Get::Upgrade-Allow-New.
--no-upgrade Do not upgrade packages; when used in conjunction with install, no-upgrade will prevent packages on the command line from being upgraded if they are already installed. Configuration Item: APT::Get::Upgrade.
--only-upgrade Do not install new packages; when used in conjunction with install, only-upgrade will install upgrades for already installed packages only and ignore requests to install new packages. Configuration Item: APT::Get::Only-Upgrade.
--allow-downgrades This is a dangerous option that will cause apt to continue without prompting if it is doing downgrades. It should not be used except in very special situations. Using it can potentially destroy your system! Configuration Item: APT::Get::allow-downgrades. Introduced in APT 1.1.
--allow-remove-essential Force yes; this is a dangerous option that will cause apt to continue without prompting if it is removing essentials. It should not be used except in very special situations. Using it can potentially destroy your system! Configuration Item: APT::Get::allow-remove-essential. Introduced in APT 1.1.
--allow-change-held-packages Force yes; this is a dangerous option that will cause apt to continue without prompting if it is changing held packages. It should not be used except in very special situations. Using it can potentially destroy your system! Configuration Item: APT::Get::allow-change-held-packages. Introduced in APT 1.1.
--force-yes Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should not be used except in very special situations. Using force-yes can potentially destroy your system! Configuration Item: APT::Get::force-yes. This is deprecated and replaced by --allow-unauthenticated , --allow-downgrades , --allow-remove-essential , --allow-change-held-packages in 1.1.
--print-uris Instead of fetching the files to install their URIs are printed. Each URI will have the path, the destination file name, the size and the expected MD5 hash. Note that the file name to write to will not always match the file name on the remote site! This also works with the source and update commands. When used with the update command the MD5 and size are not included, and it is up to the user to decompress any compressed files. Configuration Item: APT::Get::Print-URIs.
--purge Use purge instead of remove for anything that would be removed. An asterisk ("*") will be displayed next to packages which are scheduled to be purged.  remove --purge is equivalent to the purge command. Configuration Item: APT::Get::Purge.
--reinstall Re-install packages that are already installed and at the newest version. Configuration Item: APT::Get::ReInstall.
--list-cleanup This option is on by default; use --no-list-cleanup to turn it off. When it is on, apt-get will automatically manage the contents of /var/lib/apt/lists to ensure that obsolete files are erased. The only reason to turn it off is if you frequently change your sources list. Configuration Item: APT::Get::List-Cleanup.
-t, --target-release, --default-release This option controls the default input to the policy engine; it creates a default pin at priority 990 using the specified release string. This overrides the general settings in /etc/apt/preferences. Specifically pinned packages are not affected by the value of this option. In short, this option lets you have simple control over which distribution packages will be retrieved from. Some common examples might be -t '2.1*', -t unstable or -t sid. Configuration Item: APT::Default-Release; see also the apt_preferences(5) manual page.
--trivial-only Only perform operations that are 'trivial'. Logically this can be considered related to --assume-yes; where --assume-yes will answer yes to any prompt, --trivial-only will answer no. Configuration Item: APT::Get::Trivial-Only.
--mark-auto After successful installation, mark all freshly installed packages as automatically installed, which will cause each of the packages to be removed when no more manually installed packages depend on this package. This is equally to running apt-mark auto for all installed packages. Configuration Item: APT::Get::Mark-Auto.
--no-remove If any packages are to be removed apt-get immediately aborts without prompting. Configuration Item: APT::Get::Remove.
--auto-remove, --autoremove If the command is either install or remove, then this option acts like running the autoremove command, removing unused dependency packages. Configuration Item: APT::Get::AutomaticRemove.
--only-source Only has meaning for the source and build-dep commands. Indicates that the given source names are not to be mapped through the binary table. This means that if this option is specified, these commands will only accept source package names as arguments, rather than accepting binary package names and looking up the corresponding source package. Configuration Item: APT::Get::Only-Source.
--diff-only, --dsc-only, --tar-only Download only the diff, dsc, or tar file of a source archive. Configuration Item: APT::Get::Diff-Only, APT::Get::Dsc-Only, and APT::Get::Tar-Only.
--arch-only Only process architecture-dependent build-dependencies. Configuration Item: APT::Get::Arch-Only.
--indep-only Only process architecture-independent build-dependencies. Configuration Item: APT::Get::Indep-Only.
--allow-unauthenticated Ignore if packages can't be authenticated and don't prompt about it. This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the user itself. The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override. Configuration Item: APT::Get::AllowUnauthenticated.
--no-allow-insecure-repositories Forbid the update command to acquire unverifiable data from configured sources. APT will fail at the update command for repositories without valid cryptographically signatures. See also apt-secure(8) for details on the concept and the implications. Configuration Item: Acquire::AllowInsecureRepositories.
--allow-releaseinfo-change Allow the update command to continue downloading data from a repository which changed its information of the release contained in the repository indicating e.g a new major release. APT will fail at the update command for such repositories until the change is confirmed to ensure the user is prepared for the change. See also apt-secure(8) for details on the concept and configuration.
Specialist options (--allow-releaseinfo-change-field) exist to allow changes only for certain fields like origin, label, codename, suite, version and defaultpin. See also apt_preferences(5). Configuration Item: Acquire::AllowReleaseInfoChange.
--show-progress Show user friendly progress information in the terminal window when packages are installed, upgraded or removed. For a machine parsable version of this data see README.progress-reporting in the apt doc directory. Configuration Items: Dpkg::Progress and Dpkg::Progress-Fancy.
--with-source filename Adds the given file as a source for metadata. Can be repeated to add multiple files. See --with-source description in apt-cache(8) for further details.
-eany, --error-on=any Fail the update command if any error occured, even a transient one.
/etc/apt/apt.conf APT configuration file. Configuration Item: Dir::Etc::Main.
/etc/apt/apt.conf.d/ APT configuration file fragments. Configuration Item: Dir::Etc::Parts.
/etc/apt/preferences Version preferences file. This is where you would specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution. Configuration Item: Dir::Etc::Preferences.
/etc/apt/preferences.d/ File fragments for the version preferences. Configuration Item: Dir::Etc::PreferencesParts.
/var/cache/apt/archives/ Storage area for retrieved package files. Configuration Item: Dir::Cache::Archives.
/var/cache/apt/archives/partial/ Storage area for package files in transit. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended)
apt-cache(8), apt-cdrom(8), dpkg(1), sources.list(5), apt.conf(5), apt- config(8), apt-secure(8), The APT User's guide in /usr/share/doc/apt-doc/, apt_preferences(5), the APT Howto.
apt-get returns zero on normal operation, decimal 100 on error.
chromium(1)                       USER COMMANDS                      chromium(1)
chromium - the web browser from Google
chromium [OPTION] [PATH|URL]
See the Google Chrome help center for help on using the browser.
<https://support.google.com/chrome/>
This manpage only describes invocation, environment, and arguments.
Chromium has hundreds of undocumented command-line flags that are added and removed at the whim of the developers.  Here, we document relatively stable flags.
--user-data-dir=DIR Specifies the directory that user data (your "profile") is kept in.  Defaults to $HOME/.config/chromium .  Separate instances of Chromium must use separate user data directories; repeated invocations of chromium will reuse an existing process for a given user data directory.
--app=URL Runs URL in "app mode": with no browser toolbars.
--incognito Open in incognito mode.
--new-window If PATH or URL is given, open it in a new window.
--proxy-server=host:port Specify the HTTP/SOCKS4/SOCKS5 proxy server to use for requests. This overrides any environment variables or settings picked via the options dialog.  An individual proxy server is specified using the format:
[<proxy-scheme>://]<proxy-host>[:<proxy-port>]
Where <proxy-scheme> is the protocol of the proxy server, and is one of:
"http", "socks", "socks4", "socks5".
If the <proxy-scheme> is omitted, it defaults to "http". Also note that "socks" is equivalent to "socks5".
--proxy-server="foopy:99" Use the HTTP proxy "foopy:99" to load all URLs.
--proxy-server="socks://foobar:1080" Use the SOCKS v5 proxy "foobar:1080" to load all URLs.
--proxy-server="socks4://foobar:1080" Use the SOCKS v4 proxy "foobar:1080" to load all URLs.
--proxy-server="socks5://foobar:66" Use the SOCKS v5 proxy "foobar:66" to load all URLs.
It is also possible to specify a separate proxy server for different URL types, by prefixing the proxy server specifier with a URL specifier:
--proxy-server="https=proxy1:80;http=socks4://baz:1080" Load https://* URLs using the HTTP proxy "proxy1:80". And load http://* URLs using the SOCKS v4 proxy "baz:1080".
--no-proxy-server Disables the proxy server.  Overrides any environment variables or settings picked via the options dialog.
--proxy-auto-detect Autodetect proxy configuration.  Overrides any environment variables or settings picked via the options dialog.
--proxy-pac-url=URL Specify proxy autoconfiguration URL.  Overrides any environment variables or settings picked via the options dialog.
--password-store=<basic|gnome|kwallet> Set the password store to use.  The default is to automatically detect based on the desktop environment.  basic selects the built in, unencrypted password store.  gnome selects Gnome keyring. kwallet selects (KDE) KWallet.  (Note that KWallet may not work reliably outside KDE.)
As a GTK+ app, Chromium also obeys GTK+ command-line flags, such as --display.  See the GTK documentation for more: