dpkg-scanpackages(1)

πŸ¦‹ dpkg-scanpackages β€” like, the manual page, bestie

okay so this is the dpkg-scanpackages(1) page from the dpkg suite, and it's genuinely one of my faves because it's the little gremlin that builds your Packages index. sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

dpkg-scanpackages β€” the girl who creates Packages index files πŸ’…


🌸 SYNOPSIS 🌸

dpkg-scanpackages [option...] binary-path [override-file [path-prefix]]
> Packages

yes the > Packages is literally part of the vibe β€” you're piping that output into a file. redirect queen πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: dpkg-scanpackages sorts through a whole tree of Debian binary packages and creates a Packages file. and what's a Packages file for? it's what apt(8), dselect(1) and friends read so they can tell the user what packages are actually available to install. no cap, it's the menu at the restaurant 😭

these Packages files are exactly the same as the ones you'd find on Debian archive sites and media discs. so like, you might fr use dpkg-scanpackages yourself if you're making a directory of local packages to install across a cluster of machines. main character energy for sysadmins πŸ’œ

⭐ note note note: if you want apt(8) to actually, y'know, see the Packages file you generated, you're probably gonna need to compress it β€” xz(1) (makes a Packages.xz file), bzip2(1) (makes Packages.bz2), or gzip(1) (makes Packages.gz). because apt(8) ignores uncompressed Packages files β€” except on local access, i.e. file:// sources. so like, don't forget this step, i'm begging πŸ™ˆ

okay now the arguments, one by one:

  • binary-path β€” the name of the tree of binary packages you're processing (example in the original: contrib/binary-i386 🫢). and listen: it is best to make this relative to the root of the Debian archive, because every Filename field in the shiny new Packages file is gonna start with this string. so like, think before you type, bestie.
  • override-file β€” the name of a file to read that contains info about how the package fits into the distribution. and good news: the file can be compressed (since dpkg 1.15.5). see deb-override(5) for the deets.
  • path-prefix β€” an optional string that gets prepended to the Filename fields. little prefix, big impact ✨

and the deduplication tea β˜•: if more than one version of a package is found, only the newest one makes it into the output. and if they have the same version and only differ in architecture, only the first one found is used. periodt.


πŸ’… OPTIONS πŸ’…

  • -t, --type type β€” scan for *.type packages instead of *.deb. customize ur search, slay.
  • -e, --extra-override file β€” scan file to find supplementary overrides. this file can be compressed too (since dpkg 1.15.5). see deb-extra-override(5) for more info on the format. iykyk.
  • -a, --arch arch β€” use a pattern made of *_all.deb and *_arch.deb, or just *_arch.deb if --no-implicit-arch has been specified, instead of scanning for all debs. narrowing it down, we love to see it.
  • --no-implicit-arch β€” do not implicitly add architecture all binary packages when you specify --arch. supported since dpkg 1.23.6.
  • -h, --hash hash-list β€” only generate file hashes for the comma-specified list you give it. default is to generate all currently supported hashes. supported values: md5, sha1, sha256. supported since dpkg 1.17.14.
  • -m, --multiversion β€” include all the packages it found in the output. no dedup, no drama, all of them πŸ’€
  • -M, --medium id-string β€” add an X-Medium field containing the value id-string. this field is required if you want to generate Packages.cd files for use by the media access method of dselect. supported since dpkg 1.15.5.
  • -?, --help β€” show the usage message and dip. exit stage left πŸšͺ
  • --version β€” show the version and exit. iconic.

🌈 ENVIRONMENT 🌈

  • DPKG_COLORS β€” sets the color mode. currently accepted values are: auto (the default), always and never. supported since dpkg 1.18.5. aesthetic settings, we stan 🎨
  • DPKG_NLS β€” if it's set, it decides whether to activate Native Language Support, aka internationalization (or i18n) support. accepted values are: 0 and 1 (the default). supported since dpkg 1.19.0. multilingual queen 🌍

πŸ”₯ DIAGNOSTICS πŸ”₯

dpkg-scanpackages outputs the usual self-explanatory errors. it also warns you about packages that:

  • are in the wrong subdirectory
  • are duplicated
  • have a Filename field in their control file
  • are missing from the override file
  • have maintainer substitutions which do not take effect

so like, if it's yelling at you, it's probably right 😭 read the warnings, bestie.


🫢 SEE ALSO 🫢

dpkg(1), dselect(1), deb-override(5), deb-extra-override(5), dpkg-scansources(1).

go read those too, they're the friend group πŸ’–


and that's the page!! version 1.23.11-dirty, dated 2026-09-09 β€” from the dpkg suite, with love. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from