I am packaging my first debian project, and I have things 100% worked out with gnu-make (anything is possible here, for me, and so my difficulties right now are exclusively in navigating the dpkg/debuild system).

I have, right now, just some dummy compilations in place with the following rules file and compatibility:

// debian/compat

// debian/rules

#!/usr/bin/make -f
  dh $@

  cat binaries.txt | xargs -I arg install -D -m 0755 arg $$(pwd)/debian/package/opt/package/arg

Assume that all compilations and source files are managed via make in the directory containing debian directory perfectly -- I have a minimal case that works just as expected.

// binaries.txt

is just a binaries file that lists out the dummy binaries my trivial make process produces.

I am attempting to code a deb_helper symlink to symlink my binaries in /opt/package to /usr/local/bin according to the documentation here:


But I am not having much luck. What is the procedure on this?

1 Answer 1


If you want to ship symlinks in your package, I would recommend using dh_link. The easiest way to do that is to list the symlinks you want in debian/links (or debian/package.links if your source package builds multiple binary packages):

opt/package/bin/foo usr/bin/foo
opt/package/bin/bar usr/bin/bar

Debian packages aren’t supposed to ship any files under /usr/local so the build tools don’t support that too well.

If you don’t need anything else in /opt/package, you could install your binaries directly to /usr/bin.

You can also use dh_install to simplify your installation, by listing the binaries you want to install in debian/install:

foo opt/package/bin
bar opt/package/bin


foo usr/bin
bar usr/bin

You can then drop the dh_auto_install override.

  • with respect to the "debian/install" file, is this interpreted like the rules file, or can this be rendered interactive--for example, I prefix with a hash-bang for bash and evaluate a find command?
    – Chris
    Commented Sep 17, 2019 at 16:41
  • 1
    It can be made dynamic, as can any debhelper file: make it executable, add the appropriate shebang, and ensure the resulting output matches the expected format (so something like find ... -printf "%f usr/bin\n"). Commented Sep 17, 2019 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .