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-repack will place the created package in the current directory. yes, wherever you're standing. vibe check your pwd first 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=/mnt to 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-repack might not be able to tell if an installed package is architecture all or is specific to the system's architecture, in case it lacks the Architecture field. If you know the package architecture, you can use this option to force dpkg-repack to 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 to dpkg-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 using fakeroot -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 file Description field. 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 example Depends or Breaks relationships. 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