DH_LINK(1)
π DH_LINK π
okay bestie, so this is dh_link from the Debhelper manual, section 1 (user commands). sit down, grab a strawberry, we're making symlinks β¨
β¨ NAME β¨
dh_link β create symlinks in package build directories π
π¦ SYNOPSIS π¦
dh_link [debhelper options] [-A] [-Xitem] [source destination ...]
π DESCRIPTION π
dh_link is a debhelper program, and what it does is create symlinks in package build directories. that's the whole job. it's giving link-maker, main character energy π₯
so here's the vibe: you hand it a list of pairs of source and destination files. the source files are the ones that already exist β the things being pointed at (what ln(1) calls the target). the destination files are the symlinks that get created (what ln(1) calls the link name). and the count has to match, bestie β there must be an equal number of source and destination files specified. no leftovers, no extras.
be SURE you hand over the absolute path to both the source and the destination. yes, unlike what you'd do with something like ln(1). plot twist though: the leading slash is optional. cute right π
now the fun part: dh_link will generate symlinks that comply with Debian policy β absolute when policy says they should be absolute, and relative links with as short a path as possible. it'll also create any subdirectories it needs to put the symlinks in. no cap, it just handles it π
also: any pre-existing destination files will be replaced with symlinks. gone. replaced. slay π
and one more thing β dh_link also scans the package build tree for existing symlinks which do not conform to Debian policy, and corrects them (that's v4 or later). it's policing the vibes β¨
πΈ FILES πΈ
debian/package.linksβ lists pairs of source and destination files to be symlinked. each pair goes on its own line, with the source and destination separated by whitespace.- in each pair the source file (called target by
ln(1)) comes first, followed by the destination file (called link name byln(1)). so the pairs of source and destination files in each line are given in the same order as they would be given toln(1). same order, bestie, don't flip them π - in contrast to
ln(1), the source and destination paths must be absolute (the leading slash is optional π). - supports substitution variables in compat 13 and later, as documented in
debhelper(7). iykyk π
- in each pair the source file (called target by
π OPTIONS π
-A,--allβ create any links specified by command line parameters in ALL packages acted on, not just the first. all of them. every single one. periodt π-Xitem,--exclude=itemβ exclude symlinks that contain item anywhere in their filename from being corrected to comply with Debian policy. like, leave those ones alone, they're fine as they are π«Ά- source destination ... β create a file named destination as a link to a file named source. do this in the package build directory of the first package acted on. (or in all packages if
-Ais specified.) π
β EXAMPLES β
dh_link usr/share/man/man1/foo.1 usr/share/man/man1/bar.1
make bar.1 be a symlink to foo.1 π¦
dh_link var/lib/foo usr/lib/foo \
usr/share/man/man1/foo.1 usr/share/man/man1/bar.1
make /usr/lib/foo/ be a link to /var/lib/foo/, and bar.1 be a symlink to the foo.1 β¨
var/lib/foo usr/lib/foo
usr/share/man/man1/foo.1 usr/share/man/man1/bar.1
same as above but as content for a debian/package.links file. literally the same thing, just living in a file instead π
π SEE ALSO π
this program is a part of debhelper. one of the family fr fr π
π«Ά AUTHOR π«Ά
Joey Hess <joeyh@debian.org> β icon, legend, the moment π
okay that's the whole page bestie, no notes, we ate π
this was version 14.5ubuntu1, dated 2026-09-21, and it's DH_LINK(1) from the Debhelper manual β go forth and symlink responsibly, mwah π
β¨
π¦ 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