deb-preinst(5)
π deb-preinst β the manual page bestie
ok so real talk: this is deb-preinst(5) from the dpkg suite, and it's about that one little file that runs before your package even gets installed. pre-installation maintainer script vibes π
πΈ NAME πΈ
deb-preinst β the package pre-installation maintainer script. yes that's its whole job and it's iconic for it π
β¨ SYNOPSIS β¨
DEBIAN/preinst
that's it. that's the whole path. slay π
π¦ DESCRIPTION π¦
okay so here's the tea: a package can do a whole bunch of pre-installation stuff (several pre-installation actions, fr fr) using maintainer scripts. how? by putting an executable preinst file inside its control archive β that's DEBIAN/preinst while you're building the package. no cap, that's the whole mechanism π«Ά
the script can get called in the following ways, and you need to handle all of them:
new-preinst installβ gets called before the package is installed. like, right before. main character timing β¨new-preinst install old-version new-versionβ gets called before a removed package is upgraded. support fornew-versionhas been a thing since dpkg 1.18.5, iykyk πnew-preinst upgrade old-version new-versionβ gets called before the package is upgraded. support fornew-versionsince dpkg 1.18.5, same deal π¦old-preinst abort-upgrade new-versionβ gets called ifpostrmfails during an upgrade, or fails on a failed upgrade. messy but necessary ππ
lowkey important: make sure your preinst is executable β that word is doing a lot of work in that sentence π
π SEE ALSO π
dpkg(1)β the main character herself π
that's the whole page bestie, go forth and write a preinst that doesn't break everything π§π
signed off with love from the dpkg suite, version 1.23.11-dirty, dated 2026-09-09 π
π¦ where this page comes from
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms