# dpkg-realpath(1) - man - phpman

[dpkg-realpath(1)](https://www.chedong.com/phpMan.php/man/dpkg-realpath/1/markdown)                             dpkg suite                             [dpkg-realpath(1)](https://www.chedong.com/phpMan.php/man/dpkg-realpath/1/markdown)



## NAME
       dpkg-realpath - print the resolved pathname with DPKG_ROOT support

## SYNOPSIS
       **dpkg-realpath** [_option_...] _pathname_

## DESCRIPTION
       **dpkg-realpath** is a tool (since dpkg 1.20.1) to resolve a pathname, that takes the [**dpkg**(1)](https://www.chedong.com/phpMan.php/man/dpkg/1/markdown)
       root directory into account, either implicitly from the **DPKG**___**ROOT** environment variable or
       from the command-line **--root** or **--instdir** options, and returns an absolute _pathname_ relative
       to the root directory.  The root directory must not be prefixed to the _pathname_ to be
       resolved.

       This is intended to be used by other **dpkg** helpers, or by maintainer scripts instead of using
       [**realpath**(1)](https://www.chedong.com/phpMan.php/man/realpath/1/markdown) or [**readlink**(1)](https://www.chedong.com/phpMan.php/man/readlink/1/markdown) to canonicalize pathnames, as these latter commands do not support
       canonicalization relative to a different root than _/_.

## OPTIONS
### -z --zero
           Use a NUL byte to end output lines instead of a new line character (since dpkg 1.20.6).

       **--instdir** _directory_
       **--root** _directory_
           Set the root directory to _directory_, which is the base directory that pathnames get
           canonicalized against.  Defaults to «**/**».

       **-?**, **--help**
           Show the usage message and exit.

### --version
           Show the version and exit.

## ENVIRONMENT
       **DPKG**___**ROOT**
           If set and the **--instdir** or **--root** options have not been specified, it will be used as
           the filesystem root directory.

       **DPKG**___**COLORS**
           Sets the color mode.  The currently accepted values are: **auto** (default), **always** and
           **never**.

## SEE ALSO
       [**realpath**(1)](https://www.chedong.com/phpMan.php/man/realpath/1/markdown), [**readlink**(1)](https://www.chedong.com/phpMan.php/man/readlink/1/markdown).



1.21.1                                       2025-09-09                             [dpkg-realpath(1)](https://www.chedong.com/phpMan.php/man/dpkg-realpath/1/markdown)
