DPKG-REPACK(1)
π DPKG-REPACK(1) β dpkg suite π
okay so bestie, welcome to the glow-up manual for dpkg-repack, part of the dpkg suite, section 1 of the manuals. this is the β¨ put-it-back-together β¨ girlie. let's get into it π«Ά
πΈ NAME πΈ
dpkg-repack β put an unpacked .deb file back together π
β¨ SYNOPSIS β¨
dpkg-repack [option...] package-name...
π¦ DESCRIPTION π¦
dpkg-repack creates a .deb file out of a Debian package that has already been installed on your system. like, it takes the mess that's already living on your machine and re-wraps it, iconic behaviour, no cap.
If any changes have been made to the package while it was unpacked (e.g. conffiles files in /etc modified), the new package will inherit the changes. (There are exceptions to this, including changes to configuration files that are not conffiles, including those managed by ucf(1).) so it's giving "your edits come with it" vibes, mostly.
The tool will try to make the package reproducible towards its original, but any changes on the filesystem or the default --tag option values, will prevent that. Using --tag=none might make it possible to reproduce the original package, but it will not guarantee it. lowkey it's trying its best, but it's not making promises.
This utility can make it easy to copy packages from one computer to another, or to recreate packages that are installed on your system, but no longer available elsewhere. so like, rescuing a package from the void? main character energy fr fr.
Note:dpkg-repackwill place the created package in the current directory. yes, wherever you're standing. vibe check yourpwdfirst bestie π
π OPTIONS π
--root=dir β Take package from filesystem rooted on dir. This is useful if, for example, you have another computer NFS mounted on/mnt, then you can use--root=/mntto reassemble packages from that computer. it's like reaching into someone else's closet π§--arch=architecture β Make the package be for a specific architecture.dpkg-repackmight not be able to tell if an installed package is architectureallor is specific to the system's architecture, in case it lacks theArchitecturefield. If you know the package architecture, you can use this option to forcedpkg-repackto use the right architecture. so if it's confused about which architecture it is and you already know, just tell it, we love a decisive queen β¨-d,--deb-option=option β Pass option as build argument todpkg-deb. This option can be specified multiple times. stack 'em like bracelets π--generateβ Generate a temporary directory suitable for building a package from, but do not actually create the package. This is useful if you want to move files around in the package before building it. The package can be built from this temporary directory by running"dpkg-deb --build dir ."as root (or by usingfakeroot -u), where dir is the generated directory. it's the "unpack it, rearrange it, then commit" pipeline π₯--tag=thing[,...]β Specify a comma-separated list of things to tag in the package as having been repackaged. The current list of things to tag is:noneβ Tag nothing. This can be specified first to be augmented by more specific things.
This option is required to try to generate a reproducible package. so yeah, if you want any hope of reproducibility, this one's non-negotiable π
descriptionβ Append a timestamped"Repackaged by dpkg-repack"tagline to the package's control fileDescriptionfield. This tag is enabled by default. so it's already on by default, it's just that girl πversionβ Append a"+repack"tag to the package version. This option might invalidate versioned dependencies from other packages, for exampleDependsorBreaksrelationships. careful bestie, this can break stuff downstream.allβ Tag everything. go big or go home π
package-nameβ The name of the package to attempt to repack. Multiple packages can be listed. bring your whole friend group, the more the merrier π
π BUGS π
There is a tricky situation that can occur if you dpkg-repack a package that has modified conffiles. The modified conffiles are packed up. Now if you install the package, dpkg(1) does not realize that the conffiles in it are modified. So if you later upgrade to a new version of the package, dpkg(1) will believe that the old (repacked) package has older conffiles than the new version, and will silently replace the conffiles with those in the package you are upgrading to. not me getting my configs overwritten with zero warning π so yeah. be aware.
While dpkg-repack can be run under fakeroot(1) and will work most of the time, fakeroot -u must be used if any of the files to be repacked are owned by non-root users. Otherwise the package will have them owned by root. dpkg-repack will warn if you run it under fakeroot(1) without the -u flag. so it will tell you, but like, use the -u, okay? π«Ά
π SEE ALSO π
dpkg(1), dpkg-deb(1), fakeroot(1).
and that's the whole page, bestie!! π this is version 1.55, dated 2026-04-20, straight from the dpkg suite β go forth and repack your little heart out πβ¨πΈ
π¦ where this page comes from
- ubuntu stonking: dpkg-repack 1.55 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms