---
name: "dh_installexamples"
section: "1"
platform: "linux"
package: "debhelper"
version: "13.24.2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/dh_installexamples"
---

# dh\_installexamples(1)

install example files into package build directories

## NAME

dh\_installexamples - install example files into package build directories

## SYNOPSIS

**dh\_installexamples** \[*debhelper options*\] \[**-A**\] \[**-X***item*\] \[*file* ...\]

## DESCRIPTION

**dh\_installexamples** is a debhelper program that is responsible for installing examples into *usr/share/doc/package/examples* in package build directories.

From debhelper compatibility level 11 on, **dh\_install** will fall back to looking in *debian/tmp* for files, if it does not find them in the current directory (or wherever you've told it to look using **--sourcedir**).

## FILES

- debian/*package*.examples

  Lists example files or directories to be installed.

  If upstream provides an *examples* directory, you will often want to use **examples/\*** rather than **examples** in this file.  The latter would create */usr/share/doc/package/examples/examples*, which is rarely what you want.

  Supports substitution variables in compat 13 and later as documented in [**debhelper**(7)](/debhelper/7.md).

## OPTIONS

- **-A**, **--all**

  Install any files specified by command line parameters in ALL packages acted on.

- **--sourcedir=***dir*

  Look in the specified directory for files to be installed.  This option requires compat 11 or later (it is silently ignored in compat 10 or earlier).

  Note that this is not the same as the **--sourcedirectory** option used by the **dh\_auto\_***\** commands. You rarely need to use this option, since **dh\_installexamples** automatically looks for files in *debian/tmp* in debhelper compatibility level 11 and above.

- **--doc-main-package=***main-package*

  Set the main package for a documentation package.  This is used to install the documentation of the documentation package in */usr/share/doc/main-package* as recommended by the Debian policy manual 3.9.7 in §12.3.

  In compat 11 (or later), this option is only useful if debhelper's auto-detection of the main package is wrong.  The option can also be used to silence a warning from debhelper when the auto-detection fails but the default happens to be correct.

  This option cannot be used when **dh\_installexamples** is instructed to act on multiple packages.  If you need this option, you will generally need to combine it with **-p** to ensure exactly one package is acted on.

- **-X***item*, **--exclude=***item*

  Exclude files that contain *item* anywhere in their filename from being installed.

- *file* ...

  Install these files (or directories) as examples into the first package acted on. (Or into all packages if **-A** is specified.)

## NOTES

Note that **dh\_installexamples** will happily copy entire directory hierarchies if you ask it to (similar to **cp -a**). If it is asked to install a directory, it will install the complete contents of the directory.

## SEE ALSO

[**debhelper**(7)](/debhelper/7.md)

This program is a part of debhelper.

## AUTHOR

Joey Hess \<joeyh@debian.org\>
