=pod

=encoding utf8

=head1 NAME

cupt - console package management tool

=head1 DESCRIPTION

Cupt is a high-level package manager for Debian and Debian-based systems.

You might want to read L<cupt_tutorial(7)> (or its HTML version at
/usr/share/doc/cupt/tutorial.html) before.

=head1 SYNOPSIS

cupt [ I<option>... ] I<action> [ { I<parameter> | I<option> } ... ]

=head1 ACTIONS

=head2 Query actions

=over

=item version,-v,--version

prints versions of packages 'cupt' and 'libcupt-perl'

=item help,-h,--help

prints the short help for available actions

=item config-dump

prints all configuration variables to standard output

Example:

C<cupt config-dump>

=item show

prints version info of specified binary packages

This subcommand receives list of L</"Binary package version expression">'s, see below.

Specific options:

=over

=item --all-versions,-a

print all versions of the package, not selected one

Corresponding configuration variable: L<apt::cache::allversions>

=item --no-all-versions

don't print all versions of the package, use only selected one

Corresponding configuration variable: L<apt::cache::allversions>

=item --with-release-info

also print information about release info where the version of the package live

=back

Examples:

C<cupt show qmmp>

C<cupt show --all-versions qmmp debianutils>

C<cupt show --with-release-info audacious/testing apt debianutils=2.3.38>

=item showsrc

The same as L<show>, only for source packages.

Examples:

C<cupt showsrc --all-versions qmmp>

C<cupt showsrc --with-release-info audacious/testing apt>

C<cupt showsrc libxine1>

=item search

searches for packages that contains some string within package names and package descriptions

This subcommand receives a list a Perl-compatible Regular Expressions (PCRE) to
search. Only those packages will be printed that contain all of specified
patterns.

Specific options:

=over

=item --case-sensitive

search case-sensitively

=item --names-only,-n

search only in package names

Corresponding configuration variable: L<apt::cache::namesonly>

=item --fse,-f

Turns on functional selector expression mode. In that mode, instead of
specifying one or more regular expressions, exactly one FSE (see
L<cupt_functionalselectors(7)>) should be specified.

=back

Examples:

C<cupt search nvidia driver>

C<cupt search --case-sensitive Vim>

C<cupt search -n vim>

C<cupt search "package manager">

C<cupt search --fse 'Zbd(Pn(cupt))'>

=item showauto

prints list of automatically/manually installed packages, one package name per
line

L<cupt showauto>: prints list of automatically installed packages

L<cupt showauto --invert>: prints list of manually installed packages

=item depends

prints dependency relation expressions for given version of package

By default prints 'Pre-Depends', 'Depends' and 'Recommends' for the version.

This subcommand receives list of L</"Binary package version expression">'s, see below.

Specific options:

=over

=item --with-suggests

take also 'Suggests' dependencies into account

=item --recurse

process the dependencies recursively

Corresponding configuration variable: L<apt::cache::recursedepends>

=item --all-versions,-a

when L<--recurse|/--recurse> is specified, pick up all versions for the
relation expression, not the "best" one

Corresponding configuration variable: L<apt::cache::allversions>

=back

Examples:

C<cupt depends nlkt perl/stable>

C<cupt depends --important xserver-xorg-core>

C<cupt depends --recurse xmlto>

=item rdepends

same as L<depends>, but prints reverse relations instead of forward ones

=item why

prints one of available dependency paths between package(s)/system and the
package.

This subcommand receives a list of binary package expressions (which can be
empty), then one binary package expression without wildcards.

If the list of binary package expressions is empty (i.e. subcommand received
only one argument), then the list is build of manually installed packages in
the system.

If no dependency paths found, prints nothing.

Uses configuration variables
L<cupt::resolver::keep-recommends|/cupt::resolver::keep-recommends> and
L<cupt::resolver::keep-suggests|/cupt::resolver::keep-suggests> to determine
whether to honor Recommends and Suggests respectively when building dependency
paths.

Examples:

C<cupt why kmail libgnutls26>

C<cupt why libgnutls26>

C<cupt why icedove kmail libgnutls26>

=item policy

Given arguments, prints available versions with pins and release info for each binary package

Arguments: list of binary package names.

Given no arguments, prints available Release info for binary packages.

Specific options:

=over

=item --show-dates

Show also publish and expiration dates for each record. Works only for a second
form (i.e. no arguments).

=back

Examples:

C<cupt policy>

C<cupt policy --show-dates>

C<cupt policy dpkg>

C<cupt policy libpqxx-2.6.9ldbl libpqxx-3.0>

=item policysrc

Given arguments, prints available versions with pins and release info for each source package.

Arguments: list of source package names.

Given no arguments, prints available Release info for source packages.

Same specific options as for L</policy> subcommand.

Examples:

C<cupt policysrc>

C<cupt policysrc --show-dates>

C<cupt policysrc dpkg>

C<cupt policysrc libpqxx libpqxx3>

=item pkgnames

prints package names that start with a supplied prefix

If no prefix is given, prints all package names

Examples:

C<cupt pkgnames>

C<cupt pkgnames liba>

=item changelog

displays changelog for given versions of packages

This subcommand receives list of L</"Binary package version expression">'s, see below.

Works only with installed packages and official Debian and Ubuntu repositories.

Examples:

C<cupt changelog dpkg/installed>

C<cupt changelog --installed-only dpkg nlkt lintian>

C<cupt changelog libqtcore4>

=item copyright

displays copyright for given versions of packages

This subcommand receives list of L</"Binary package version expression">'s, see below.

Works only with installed packages and official Debian and Ubuntu repositories.

Examples:

C<cupt copyright dpkg/installed>

C<cupt copyright --installed-only dpkg nlkt lintian>

C<cupt copyright libqtcore4>

=item screenshots

open a browser window/tab with screenshots of given packages.

This subcommand receives list of package names.

Example:

C<cupt screenshots arora>

=item snapshot list

list names of the available system snapshots, one per line

This subcommand receives no arguments.

Example: C<cupt snapshot list>

=item tar-metadata

This subcommand is experimental. Its name and functionality are unstable.

Packs all cupt configuration files and repository metadata to a tar stream and
outputs it to standard output.

Example: C<< cupt tar-metadata | xz --verbose -c > cupt-metadata.tar.xz >>

=back

=head3 query-specific options

=over

=item --important,-i

don't take 'Recommends' dependencies into account

Corresponding configuration variable: L<apt::cache::important>

=item --installed-only

work only with installed versions of packages; valuable only for L</show>,
L</depends>, L</rdepends>, L</search>, L</pkgnames>, L</changelog> actions

=back

=head2 Management actions

=over

=item update

updates package indexes

This subcommand receives no arguments.

Example:

C<cupt update>

=item install

installs, upgrades or downgrades specified packages

This subcommand receives list of L</"Binary package version expression">'s, see below.

If some version of package was already installed, this command will
upgrade/downgrade it; otherwise, the package will be freshly installed.

Examples:

C<cupt install nlkt>

C<cupt install devscripts xserver-xorg/experimental xfce4-mixer=4.6.0-2>

=item remove

removes specified packages

This subcommand receives the list of package names.

Examples:

C<cupt remove nlkt>

C<cupt remove devscripts kde4-minimal>

=item purge

removes specified packages along with their configuration files.  Also this
command can purge the configuration files when the packages are removed
already.

This subcommand receives the list of package names.

Examples:

C<cupt purge nlkt>

C<cupt purge devscripts kde4-minimal>

See also the configuration option L<cupt::worker::purge>.

=item full-upgrade

performs as more upgrades of the installed packages as possible, the
recommended way to do upgrades

This subcommand is usually invoked without any further parameters:

C<cupt full-upgrade>

List of L</"Binary package version expression">'s can be however specified as additional parameters.

Example: the command C<cupt full-upgrade xserver-xorg/installed> will try to upgrade
your system, however preserving package 'xserver-xorg' to be sticked with
currently installed version.

=item safe-upgrade

the same as L</full-upgrade>, but with the change that problem resolver won't
try to remove non-automatically installed packages in order to upgrade more
packages, equivalent of 'full-upgrade --no-remove'.

=item dist-upgrade

the same as L</full-upgrade>, but firstly upgrades the package management tools,
then upgrades the whole system.

Recommended over L</full-upgrade> for major upgrades.

This subcommand cannot be run under the Cupt shell.

=item reinstall

reinstalls specified binary packages

This subcommand receives list of binary package names.

Examples:

C<cupt reinstall libc6>

=item iii

"L</install> if installed"

Same as L</install>, but silently ignores packages which are not installed.

Examples:

C<cupt iii gnash>

C<cupt iii xserver* *cupt*>

=item markauto

marks specified packages as automatically installed

This subcommand receives the list of package names.

Examples:

C<cupt markauto libstreamanalyzer0>

C<cupt markauto lsof gimp-data>

=item unmarkauto

marks specified packages as manually installed

This subcommand receives the list of package names.

Examples:

C<cupt unmarkauto kpogre>

C<cupt unmarkauto dpkg-dev>

=item satisfy

performs all needed operations to satisfy list of specified relations

This subcommand receives the list of relations or relation lines. Relation and
relation lines has the same syntax as defined in Debian Policy §7.1.

The minus sign can be appended to some of relation expression lines to make
relation expressions unsatisfied instead.

Examples:

C<< cupt satisfy "kmail (>= 4:4.2), wget (>= 1.10.0)" >>

C<< cupt satisfy "gettext (= 0.17-7)" "mail-transport-agent-" >>

=item build-dep

performs all needed operations to satisfy list of build-dependencies of
specified source packages

This subcommand receives the list of L</Source package version expression>'s.

Examples:

C<< cupt build-dep qt4-x11 >>

C<< cupt build-dep unetbootin/unstable libcdio/experimental >>

=item source

fetches Debian source files needed to build a Debian binary package

This subcommand receives the list of L</Source package version expression>'s.

Parameters:

=over

=item --tar-only

download only original tarball

=item --diff-only

download only Debian diff

=item --dsc-only

download only Debian dsc

=item --download-only

don't unpack downloaded source files

=back

Examples:

C<< cupt source libsort-fields-perl >>

C<< cupt source --diff-only libpqxx cupt/unstable >>

C<< cupt source libxine1 >>

=item clean

removes all deb archives and partially downloaded archive files from the cache on a disk

This subcommand receives no arguments.

Example: C<cupt clean>

=item autoclean

removes deb archives which are not available in package indexes and partially
downloaded archive files from the cache on a disk

This subcommand receives no arguments.

Example: C<cupt autoclean>

=item snapshot save

saves a snapshot of the current packages state

This subcommand receives one argument - desired snapshot name.

Example: C<cupt snapshot save old-udev>

=item snapshot load

returns the system (as set of installed packages) to the previously saved
state

This subcommand receives one argument - snapshot name to load.

Example: C<cupt snapshot load old-udev>

=item snapshot remove

removes the system snapshot

This subcommand receives one argument - snapshot name to remove.

Example: C<cupt snapshot remove old-libgtk>

=item snapshot rename

renames the system snapshot

This subcommand receives two arguments - old snapshot name and new snapshot
name.

Example: C<cupt snapshot rename old-libgtk 20091005>

=item shell

starts interactive shell-like environment

This subcommand receives no arguments.

This subcommand can receive all common options which will be preserved
across all session. You can override them for any subcommand in a usual way.

On every shell prompt you can supply any valid subcommand from this manual
page, using all allowed parameters, just if it was command line. Simple shell
quotes around arguments are also allowed.

You can use 'quit', 'exit', ':q' or 'q' command to exit cupt shell.

=back

=head3 management-specific options

=over

=item --no-remove

disallow problem resolver to remove manually installed packages. Packages that are marked to remove/purge in the command line will be remove/purged as usual.

Corresponding configuration option: L<cupt::resolver::no-remove>

=item --no-auto-remove

don't try to remove automatically installed packages after doing requested
actions

Corresponding configuration option: L<cupt::resolver::auto-remove>

=item --simulate,-s

don't modify anything in the system, just print supposed actions

Doesn't require root privileges.

Corresponding configuration option: L<cupt::worker::simulate>

=item --summary-only

Show only summary of actions without details.

Corresponding configuration options: L<cupt::console::actions-preview::show-summary>,
L<cupt::console::actions-preview::show-details>.

=item --no-summary

Show only details of actions without a summary.

Corresponding configuration options: L<cupt::console::actions-preview::show-summary>,
L<cupt::console::actions-preview::show-details>.

=item --resolver=

string, determines type of resolver: can be

=over

=item fair

medium-class resolver. It chooses best possible solution (by overall score)
each time. This is a default resolver.

=item full

full resolver. Guaranteed to suggest solution in precise order from the best to
the worst result score (by the resolver's opinion). Latter means that resolver
builds full resolve tree before suggesting the solutions, which means large RAM
and speed penalties. Use it with caution.

=back

Corresponding configuration option: L<cupt::resolver::type>

=item --max-solution-count=

number, determines how many maximum solutions will resolver store in memory. This
option prevents large memory grows by purging away solutions with worst scores.
Defaults to 32000.  Note that very complex requests or requests on
multi-repository system will increase size of solution tree dramatically, so
prepare to play with increasing this option accordingly.

Corresponding configuration option: L<cupt::resolver::max-solution-count>

=item --no-install-recommends,-R

cupt installs recommended packages by default, this option cancels described behavior

Corresponding configuration option: L<apt::install-recommends>

=item --show-archives,-A

when displaying actions preview prompt, display also release archives for each package

Corresponding configuration option: L<cupt::console::actions-preview::show-archives>

=item --show-codenames,-N

when displaying actions preview prompt, display also release codenames for each package

This option cannot be used together with --show-archives.

Corresponding configuration option: L<cupt::console::actions-preview::show-codenames>

=item --show-components,-C

when displaying actions preview prompt, display also release components for each package

Corresponding configuration option: L<cupt::console::actions-preview::show-components>

=item --show-versions,-V

when displaying actions preview prompt, display also versions of packages

Corresponding configuration option: L<cupt::console::actions-preview::show-versions>

=item --show-vendors,-O

when displaying actions preview prompt, display also vendors of packages

Corresponding configuration option: L<cupt::console::actions-preview::show-vendors>

=item --show-size-changes,-Z

when displaying actions preview prompt, display also changes in disk space
usage for each package

Corresponding configuration option: L<cupt::console::actions-preview::show-size-changes>

=item --show-reasons,--show-deps,-D

when displaying actions preview prompt, display also reasons why this action was
considered to perform

Corresponding configuration option: L<cupt::console::actions-preview::show-reasons>

=item --show-not-preferred

when displaying actions preview prompt, display also packages which will have a
not preferred version after the proposed changes

Corresponding configuration option: L<cupt::console::actions-preview::show-not-preferred>

=item --download-only,-d

stop after download stage, don't modify the system

Corresponding configuration option: L<cupt::worker::download-only>

=item --assume-yes,--yes,-y

don't ask for solution confirmation, assume the answer is 'y' ("yes"), except
for dangerous actions, where assume 'q' ("decline and exit")

Corresponding configuration options: L<apt::get::assume-yes>, L<cupt::console::assume-yes>

=back

=head3 management modifiers: action override options

Unlike all the other options, these ones are positional and are effective only
for the rest of parameters (and before next override option if any). One can
specify as many action override options as needed.

=over

=item --install

install the rest of packages

=item --remove

remove rest of packages

=item --purge

purge the rest of packages

=item --satisfy

satisfy the rest of relation expressions

=item --unsatisfy

unsatisfy the rest of relation expressions

=item --iii

"install if installed" (see L</iii> subcommand) the rest of packages

=item --reinstall

reinstall the rest of packages

=item --markauto

mark as automatically installed (see L</markauto> subcommand) the rest of packages

=item --unmarkauto

mark as manually installed (see L</unmarkauto>) subcommand the rest of packages

=item --asauto=yes

in addition to following actions, also mark packages as automatically installed

=item --asauto=no

in addition to following actions, also mark packages as manually installed

=item --asauto=default

reset any previous C<--asauto> switches (to default mode, which is: mark newly
installed packages (except for satisfy-type actions) as manually installed and
preserve auto-status otherwise)

=back

=head3 management modifiers: request type options

=over

=item --select=traditional,--st

for install-type actions, request installing the best of chosen versions for
each package; for remove-type actions, request removing the whole package. This
is the default.

=item --select=flexible,--sf

for install-type actions, request installing any of chosen versions for each
package; for remove-type actions, request removing only chosen versions for
each package.

=back

=head3 management modifiers: request importance options

=over

=item --importance=must,--must

the following actions must be unconditionally performed, in other words,
mandatory. This is the default.

=item --importance=try,--try

the following actions are optional, but relatively big
(L<cupt::resolver::score::unsatisfied-try>) penalty will be applied for each
non-satisfied request

=item --importance=wish,--wish

the following actions are optional, but relatively small
(L<cupt::resolver::score::unsatisfied-wish>) penalty will be applied for each
non-satisfied request

=item --importance=<value>

(where <value> is a positive integer) the following actions are optional, but
exact penalty of <value> will be applied for each non-satisfied request

=back

=head3 management modifiers: package name suffixes

=over

=item -

remove the package, can be used in non-remove actions

Examples:

C<cupt install kde4 icewm-> - install the package
'kde4' and remove the package 'icewm' simultaneously.

C<cupt full-upgrade iceweasel- icedove-> - upgrade the system, deleting iceweasel and icedove

=item +

install the package, can be used in remove actions

Examples:

C<cupt remove kde konqueror+> - remove kde, but install/upgrade konqueror

C<cupt remove kde konqueror/installed+> - remove kde, but leave konqueror

=back

=head1 EXPRESSIONS

This section documents some common expressions used by actions.

=head2 Binary package version expression

I<package_name>[I<modifier>]

selects one version of given binary package.

Possible modifiers:

=over

=item <none>

selects L<policy version|/"Policy version"> of the package

Example: C<audacious>.

=item =<version string>

selects specified version of the package

Example: C<audacious=1.5.1-2>

=item /<distribution>

selects a version from specified distribution (archive name or codename)

Examples: C<audacious/lenny> (by codename), C<audacious/stable> (by archive name)

=item /installed

selects installed version of the package

Example: C<audacious/installed>

=back

Also, you may specify shell wildcars '*' and '?' in the package names.

Examples: C<xfce4-*>, C<python2.5-*/unstable>, C<?aff*/installed>

For all management subcommands, there is also '@<path-to-file>' syntax. In this
case this construction will be substituted by binary package expressions listed
in the specified file one by line.

=head2 Source package version expression

I<package_name>[I<modifier>]

selects one version of given source package.

Possible modifiers are identical to those defined in L</Binary package version
expression>, except for '/installed'.

Also, you can specify L</Binary package version expression> as
L</Source package version expression>, then binary-to-source mapping
will be performed.

=head2 Functional selectors

You can also use functional selectors (L<cupt_functionalselectors(7)>)
whereever L</Binary package version expression> or L</Source package version
expression> is expected.

=head1 COMMON OPTIONS

=over

=item --option=,-o

sets specified configuration option, syntax: "<name>=<value>"

Examples:

C<cupt remove nlkt -o 'cupt::resolver::keep-recommends=0'> (regular option)

C<cupt remove nlkt -o 'apt::neverautoremove::=libcanberra0> (list option)

=item --target-release=,--default-release=,-t

sets preferred release to pick up packages from, you can specify codename or archive name

Corresponding configuration option: L<apt::default-release>

Examples: C<cupt install -t unstable xserver-xorg>, C<cupt -t squeeze full-upgrade>

=item --include-archives=

Use only repositories with specified archive names (comma-separated).

Corresponding configuration options:
L<cupt::cache::limit-releases::by-archive>,
L<cupt::cache::limit-releases::by-archive::type>.

Example:

C<cupt safe-upgrade --include-archives=stable,stable-updates>

=item --exclude-archives=

Ignore repositories with specified archive names (comma-separated).

Corresponding configuration options:
L<cupt::cache::limit-releases::by-archive>,
L<cupt::cache::limit-releases::by-archive::type>.

Example:

C<cupt rdepends libcomerr2 --exclude-archives=experimental,unstable>

=item --include-codenames=

Use only repositories with specified codenames (comma-separated).

Corresponding configuration options:
L<cupt::cache::limit-releases::by-codename>,
L<cupt::cache::limit-releases::by-codename::type>.

Example:

C<cupt safe-upgrade --include-codenames=squeeze,squeeze-updates>

=item --exclude-codenames=

Ignore repositories with specified codenames (comma-separated).

Corresponding configuration options:
L<cupt::cache::limit-releases::by-codename>,
L<cupt::cache::limit-releases::by-codename::type>.

Example:

C<cupt rdepends libcomerr2 --exclude-codenames=experimental,sid>

=item --quiet,-q

don't output anything to standard output

=back

=head1 CONFIGURATION VARIABLES

See L<cupt.conf(5)>.

=head1 REPORTING

Please report all bugs in Cupt to Debian BTS using L<reportbug(1)>.

The user support mailing list is cupt-user@lists.alioth.debian.org. The
discussion channel about Cupt is irc://irc.debian.org#cupt.

=head1 SEE ALSO

L<cupt_vs_apt(5)>, L<cupt_tutorial(7)>, L<cupt.conf(5)>, L<cupt_functionalselectors(7)>

=head1 AUTHOR

Eugene V. Lyubimkin <jackyf@debian.org>

=cut

