DH_INSTALL(1)
๐ DH_INSTALL โ okay bestie, let's install some files ๐
So the manual name is dh_install(1) and it lives in the Debhelper cinematic universe, and honestly? This page is a whole journey. Buckle up. ๐
โจ NAME โจ
dh_install โ install files into package build directories. That's it, that's the whole job, and it ate. ๐
โจ SYNOPSIS โจ
dh_install [-Xitem] [--autodest] [--sourcedir=dir] [debhelper options]
[file|dir ... destdir]
โจ DESCRIPTION โจ
okay so dh_install is a debhelper program whose entire main character energy is about installing files into package build directories. ๐
Real talk though โ there's a whole friend group of dh_install* commands that handle installing specific types of files (documentation, examples, man pages, and so on), and like... you should use those whenever you can, because they come with extra intelligence baked in for their particular little tasks. ๐ง โจ dh_install is the one you call for everything else โ the stuff where no special intelligence is needed. It's literally the glow-up replacement for the old dh_movefiles command. ๐
This program may be used in one of two ways, and both are valid, both are iconic:
- Maybe you just have a file or two that the upstream
Makefiledoes not install for you โ then you just rundh_installon them and move them into place. Easy. - Or maybe you have a large package that builds multiple binary packages ๐ฏ. In that case you can let the upstream
Makefileinstall everything intodebian/tmp, and then bring indh_installto copy directories and files from there into the proper package build directories.
And here's a fun fact ๐ซถ: from debhelper compatibility level 7 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). Fallback queen fr fr.
โจ FILES โจ
debian/package.install
This is where you list the files to install into each package, plus the directory they should be installed to. The format is a set of lines, where each line lists a file or files to install, and at the end of the line it tells you the directory it should be installed in. ๐
The name of the files (or directories) to install should be given relative to the current directory, while the installation directory is given relative to the package build directory. And yes bestie, you may use wildcards in the names of the files to install. ๐
๐ Note: if you list exactly one filename or wildcard-pattern on a line by itself, with no explicit destination, thendh_installwill automatically guess the destination to use โ the same as if the--autodestoption were used. Guessing is its love language. ๐
Supports substitution variables in compat 13 and later, as documented in debhelper(7).
debian/not-installed
Used with the deprecated --list-missing and --fail-missing options. Please refer to dh_missing(1) for the documentation of this file. (Yes, it's giving "go ask your other parent" ๐ญ)
โจ OPTIONS โจ
--list-missingโ Deprecated: please usedh_missing --list-missinginstead. If you use this option,dh_installwill calldh_missingwith that option after it has processed all the files. Please seedh_missing(1)for the documentation of this option. ๐
This option is removed in compat 12. ๐
--fail-missingโ Deprecated: please usedh_missing --fail-missinginstead. If you use this option,dh_installwill calldh_missingwith that option after it has processed all the files. Please seedh_missing(1)for the documentation of this option. ๐
This option is removed in compat 12. ๐
--sourcedir=dirโ Look in the specified directory for files to be installed. ๐
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_install automatically looks for files in debian/tmp in debhelper compatibility level 7 and above. (It's giving "I already got you, babe" ๐ซถ)
--autodestโ Guess as the destination directory to install things to. If this is specified, you should not list destination directories indebian/package.installfiles or on the command line. Instead,dh_installwill guess as follows: ๐ฒ
Strip off debian/tmp (or the sourcedir if one is given) from the front of the filename, if it is present, and install into the dirname of the filename. So if the filename is debian/tmp/usr/bin, then that directory will be copied to debian/package/usr/. If the filename is debian/tmp/etc/passwd, it will be copied to debian/package/etc/. No cap, that's the whole algorithm. โจ
file|dir ... destdirโ Lists files (or directories) to install and where to install them to. The files will be installed into the first packagedh_installacts on. ๐ฅ
โจ EXAMPLES โจ
Here are some small examples of configuration files for dh_install. Adorable, bite-sized, snackable. ๐
# Install my-prog into usr/bin (as "usr/bin/my-prog")
my-prog usr/bin
# Install a plugins directory into usr/share/my-prog
# (as "usr/share/my-prog/plugins/")
plugins usr/share/my-prog
# Install a file with spaces in into usr/share/my-prog/data
# (as "usr/share/my-prog/data/my datafile with spaces.txt")
# ASSUMES COMPAT 13, where substitution patterns are available
my${Space}datafile${Space}with${Space}spaces.txt usr/share/my-prog/data
# Install a library into the multi-arch lib directory
# ASSUMES COMPAT 13, where substitution patterns are available
build/output/libfrop*.so.* usr/lib/${DEB_HOST_MULTIARCH}
โจ LIMITATIONS โจ
dh_install cannot rename files or directories โ it can only install them with the names they already have into wherever you want in the package build tree. It's not a makeover artist, it's a mover. ๐
There is also no way to filter out results based on build profiles or architecture. For documentation content, consider using dh_installdocs or dh_installexamples, as those helpers account for the nodoc build profile. ๐
However โ plot twist โ renaming and filtering can be achieved by using dh-exec with compatibility level 9 or later. An example debian/package.install file using dh-exec could look like: ๐
#!/usr/bin/dh-exec
debian/default.conf => /etc/my-package/start.conf
build/foo /usr/bin <!pkg.bar.nofoo>
Please remember the following three things (write them on your hand bestie, there will be a quiz ๐):
- The package must be using compatibility level 9 or later (see
debhelper(7)) - The package will need a build-dependency on
dh-exec. - The install file must be marked as executable. โ
โจ SEE ALSO โจ
This program is a part of debhelper. ๐ซถ
โจ AUTHOR โจ
Joey Hess <joeyh@debian.org> โ thank you for your service, legend ๐
and that's the whole page, bestie!! ๐ this was version 14.5ubuntu1, dated 2026-09-21, from the DH_INSTALL(1) era โ slay, periodt, go install some files, you got this ๐
โจ๐ฆ
๐ฆ where this page comes from
- ubuntu stonking: debhelper 14.5ubuntu1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms