DH_COMPRESS(1)

πŸ’– DH_COMPRESS(1) πŸ’–

okay bestie, welcome to the dh_compress page from the Debhelper manual β€” yes it's a real manpage, yes it's giving "make my package smol" energy, and yes I'm gonna walk you through every single line of it. no skimming. we're doing this properly. 🫢


✨ NAME ✨

dh_compress β€” compress files and fix symlinks in package build directories 🌸


✨ SYNOPSIS ✨

dh_compress [debhelper options] [-Xitem] [-A] [file ...]

that's it. that's the whole vibe. πŸ’…


✨ DESCRIPTION ✨

so dh_compress is a debhelper program and its whole job β€” its main character moment, fr β€” is compressing the files sitting in your package build directories. and THEN, because it's thoughtful like that, it makes sure that any symlinks that used to point at those files before they got squished are updated so they point at the new compressed versions instead. iconic behaviour, no cap. πŸ¦‹

by default, dh_compress compresses the files that Debian policy mandates should be compressed, which is:

  • everything in usr/share/info πŸ“–
  • everything in usr/share/man πŸ“š
  • files in usr/share/doc that are larger than 4k in size πŸ“¦

…except for all of these, which get a pass:

  • the copyright file
  • .html and other web files πŸ•ΈοΈ
  • image files πŸ–ΌοΈ
  • files that appear to be already compressed based on their extensions (girl, we can see you're a .gz, chill) πŸ’€

and also all changelog files get compressed. plus PCF fonts underneath usr/share/fonts/X11/ 🌈


✨ FILES ✨

πŸ’œ debian/package.compress

⚠️ bestie. these files are deprecated. like, deprecated deprecated. ⚠️

if this file exists, the default files are not compressed. instead, the file is ran as a shell script, and all filenames that the shell script outputs get compressed. the shell script runs from inside the package build directory. but note though β€” using -X is a much better idea in general; you should only use a debian/package.compress file if you really, truly need to. πŸ₯Ί


✨ OPTIONS ✨

  • -Xitem, --exclude=item β€” excludes any files that contain item anywhere in their filename from being compressed. for example, -X.tiff will exclude TIFF files from compression. you can use this option multiple times to build up a whole list of things to exclude β€” stack 'em like bracelets. πŸŽ€
  • -A, --all β€” compress all files specified by command line parameters in ALL packages acted on. all of them. every single one. periodt. πŸ‘‘
  • file ... β€” add these files to the list of files to compress. just hand 'em over. 🫢

✨ CONFORMS TO ✨

Debian policy, version 3.0 ⭐


✨ SEE ALSO ✨

this program is a part of debhelper πŸ’…


✨ AUTHOR ✨

Joey Hess <joeyh@debian.org> πŸ‘‘


and that's the whole page, bestie β€” every flag, every path, every deprecated warning, all accounted for. this was dh_compress from the Debhelper manual, version 14.5ubuntu1, dated 2026-09-21. go compress something. responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from