DH_CLEAN(1)

✨ DH_CLEAN ✨

okay bestie, welcome to the Debhelper manual page for dh_clean, and honestly? she's the cleanup crew of your dreams πŸ’…


🌸 NAME 🌸

dh_clean β€” she cleans up package build directories. that's it. that's the job. iconic behavior.


πŸ¦‹ SYNOPSIS πŸ¦‹

dh_clean [debhelper options] [-k] [-d] [-Xitem] [path ...]

πŸ’– DESCRIPTION πŸ’–

so dh_clean is a debhelper program and its whole personality is cleaning up. she should be the last step of the clean target, fr fr, because all the other debhelper commands just kinda assume she's gonna clean up after them. main character energy, truly.

she removes the package build directories, plus a bunch of other files like debian/files, plus any lil detritus the other debhelper commands left lying around. she also yeets the common files and directories that have NO business showing up in a Debian diff:

#*# *~ DEADJOE *.orig *.rej *.SUMS __pycache__ TAGS .deps/* *.P *-stamp
πŸ’€ ngl she does not run make clean to clean up after the build process. if that's the energy you want, go talk to dh_auto_clean(1) instead, bestie.

πŸŽ€ FILES πŸŽ€

  • debian/clean β€” you can list extra paths in here that you want removed too 🧹
    • heads up tho: directories listed in this file must end with a trailing slash. and yes, any content inside those directories gets removed as well. all of it. no survivors.
    • she supports substitution variables in compat 13 and later, as documented in debhelper(7). slay.

πŸ’… OPTIONS πŸ’…

  • -k, --keep β€” okay so this one is deprecated, use dh_prep(1) instead. and just so we're clear: the option is removed in compat 12. she's gone, bestie.
  • -d, --dirs-only β€” only clean the package build directories. do not clean up any other files at all. just the dirs. nothing else. periodt. πŸ™ˆ
  • -Xitem, --exclude=item β€” excludes files that contain item anywhere in their filename from being deleted, even if they'd normally get deleted. you can use this option multiple times to build up a whole list of things to exclude 🫢
  • path ... β€” delete these paths too πŸ—‘οΈ
    • same rule as before: directories passed as arguments must end with a trailing slash. any content in these directories will be removed as well.

🌈 SEE ALSO 🌈

this program is a part of debhelper. ✨


πŸ‘‘ AUTHOR πŸ‘‘

Joey Hess <joeyh@debian.org> β€” king behavior, we stan πŸ’œ


one last lil vibe check from your girl:

she removes build dirs, she removes debian/files, she removes the stray junk β€” but remember, dh_clean should be the last step of the clean target, because everyone else is counting on her. no pressure tho. πŸ’…

and that's the whole page, bestie β€” this was DH_CLEAN(1) from the Debhelper manual, version 14.5ubuntu1, dated 2026-09-21. love u, go clean your build dirs πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from