DH_LINK(1)

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 by ln(1)). so the pairs of source and destination files in each line are given in the same order as they would be given to ln(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 πŸ’œ

πŸŽ€ 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 -A is 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 πŸ‘‘

debhelper(7)

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