&apt-author.moconnor; &apt-author.team; &apt-email; &apt-product; 2018-12-11T00:00:00Z
apt-mark
8
APT

# apt-mark

show, set and unset various settings for a package

&synopsis-command-apt-mark;

## Description

`apt-mark` can be used as a unified front-end to set various settings for a package, such as marking a package as being automatically/manually installed or changing `dpkg` selections such as hold, install, deinstall and purge which are respected e.g. by `apt-get dselect-upgrade` or `aptitude`.

## Automatically and Manually Installed Packages

When you request that a package is installed, and as a result other packages are installed to satisfy its dependencies, the dependencies are marked as being automatically installed, while the package you installed explicitly is marked as manually installed. Once an automatically installed package is no longer depended on by any manually installed package it is considered no longer needed and e.g. `apt-get` or `aptitude` will at least suggest removing them.

`auto`

  `auto` is used to mark a package as being automatically installed, which will cause the package to be removed when no more manually installed packages depend on this package.

`manual`

  `manual` is used to mark a package as being manually installed, which will prevent the package from being automatically removed if no other packages depend on it.

`minimize-manual`

  `minimize-manual` is used to mark (transitive) dependencies of metapackages as automatically installed. This can be used after an installation for example, to minimize the number of manually installed packages; or continuously on systems managed by system configuration metapackages.

`showauto`

  `showauto` is used to print a list of automatically installed packages with each package on a new line. All automatically installed packages will be listed if no package is given. If packages are given only those which are automatically installed will be shown.

`showmanual`

  `showmanual` can be used in the same way as `showauto` except that it will print a list of manually installed packages instead.

### Options

`-f=&synopsis-param-filename;`
`--file=&synopsis-param-filename;`

  Read/Write package stats from the filename given with the parameter &synopsis-param-filename; instead of from the default location, which is `extended_states` in the directory defined by the Configuration Item: `Dir::State`.

## Prevent Changes for a Package

`hold`

  `hold` is used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed.

`unhold`

  `unhold` is used to cancel a previously set hold on a package to allow all actions again.

`showhold`

  `showhold` is used to print a list of packages on hold in the same way as for the other show commands.

## Schedule Packages for Install, Remove and Purge

Some front-ends like `apt-get dselect-upgrade` can be used to apply previously scheduled changes to the install state of packages. Such changes can be scheduled with the `install`, `remove` (also known as `deinstall`) and `purge` commands. Packages with a specific selection can be displayed with `showinstall`, `showremove` and `showpurge` respectively. More information about these so called dpkg selections can be found in &dpkg;.

## Options

&apt-commonoptions;

## Files

&file-extended_states;

## See Also

&apt-get;,&aptitude;,&apt-conf;

## Diagnostics

`apt-mark` returns zero on normal operation, non-zero on error.

&manbugs;