External environment
PATH This variable is expected to be defined in the environment
and point to the system paths where several required
programs are to be found. If it's not set or the programs
are not found, dpkg will abort.
HOME If set, dpkg will use it as the directory from which to
read the user specific configuration file.
TMPDIR If set, dpkg will use it as the directory in which to
create temporary files and directories.
SHELL The program dpkg will execute when starting a new
interactive shell, or when spawning a command via a shell.
PAGER
DPKG_PAGER
The program dpkg will execute when running a pager, for
example when displaying the conffile differences. If
SHELL is not set, «sh» will be used instead. The
DPKG_PAGER overrides the PAGER environment variable (since
dpkg 1.19.2).
DPKG_COLORS
Sets the color mode (since dpkg 1.18.5). The currently
accepted values are: auto (default), always and never.
DPKG_FORCE
Sets the force flags (since dpkg 1.19.5). When this
variable is present, no built-in force defaults will be
applied. If the variable is present but empty, all force
flags will be disabled.
DPKG_FRONTEND_LOCKED
Set by a package manager frontend to notify dpkg that it
should not acquire the frontend lock (since dpkg 1.19.1).
Internal environment
LESS Defined by dpkg to '-FRSXMQ', if not already set, when
spawning a pager (since dpkg 1.19.2). To change the
default behavior, this variable can be preset to some
other value including an empty string, or the PAGER or
DPKG_PAGER variables can be set to disable specific
options with «-+», for example DPKG_PAGER="less -+F".
DPKG_ROOT
Defined by dpkg on the maintainer script environment to
indicate which installation to act on (since dpkg 1.18.5).
The value is intended to be prepended to any path
maintainer scripts operate on. During normal operation,
this variable is empty. When installing packages into a
different instdir, dpkg normally invokes maintainer
scripts using chroot(2) and leaves this variable empty,
but if --force-script-chrootless is specified then the
chroot(2) call is skipped and instdir is non-empty.
DPKG_ADMINDIR
Defined by dpkg on the maintainer script environment to
indicate the dpkg administrative directory to use (since
dpkg 1.16.0). This variable is always set to the current
--admindir value.
DPKG_FORCE
Defined by dpkg on the subprocesses environment to all the
currently enabled force option names separated by commas
(since dpkg 1.19.5).
DPKG_SHELL_REASON
Defined by dpkg on the shell spawned on the conffile
prompt to examine the situation (since dpkg 1.15.6).
Current valid value: conffile-prompt.
DPKG_CONFFILE_OLD
Defined by dpkg on the shell spawned on the conffile
prompt to examine the situation (since dpkg 1.15.6).
Contains the path to the old conffile.
DPKG_CONFFILE_NEW
Defined by dpkg on the shell spawned on the conffile
prompt to examine the situation (since dpkg 1.15.6).
Contains the path to the new conffile.
DPKG_HOOK_ACTION
Defined by dpkg on the shell spawned when executing a hook
action (since dpkg 1.15.4). Contains the current dpkg
action.
DPKG_RUNNING_VERSION
Defined by dpkg on the maintainer script environment to
the version of the currently running dpkg instance (since
dpkg 1.14.17).
DPKG_MAINTSCRIPT_PACKAGE
Defined by dpkg on the maintainer script environment to
the (non-arch-qualified) package name being handled (since
dpkg 1.14.17).
DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT
Defined by dpkg on the maintainer script environment to
the package reference count, i.e. the number of package
instances with a state greater than not-installed (since
dpkg 1.17.2).
DPKG_MAINTSCRIPT_ARCH
Defined by dpkg on the maintainer script environment to
the architecture the package got built for (since dpkg
1.15.4).
DPKG_MAINTSCRIPT_NAME
Defined by dpkg on the maintainer script environment to
the name of the script running, one of preinst, postinst,
prerm or postrm (since dpkg 1.15.7).
DPKG_MAINTSCRIPT_DEBUG
Defined by dpkg on the maintainer script environment to a
value ('0' or '1') noting whether debugging has been
requested (with the --debug option) for the maintainer
scripts (since dpkg 1.18.4).