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 wantapt(8)to actually, y'know, see thePackagesfile you generated, you're probably gonna need to compress it βxz(1)(makes aPackages.xzfile),bzip2(1)(makesPackages.bz2), orgzip(1)(makesPackages.gz). becauseapt(8)ignores uncompressedPackagesfiles β 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 everyFilenamefield in the shiny newPackagesfile 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 (sincedpkg 1.15.5). seedeb-override(5)for the deets.path-prefixβ an optional string that gets prepended to theFilenamefields. 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,--typetypeβ scan for*.typepackages instead of*.deb. customize ur search, slay.-e,--extra-overridefileβ scanfileto find supplementary overrides. this file can be compressed too (sincedpkg 1.15.5). seedeb-extra-override(5)for more info on the format. iykyk.-a,--archarchβ use a pattern made of*_all.deband*_arch.deb, or just*_arch.debif--no-implicit-archhas been specified, instead of scanning for all debs. narrowing it down, we love to see it.--no-implicit-archβ do not implicitly add architectureallbinary packages when you specify--arch. supported sincedpkg 1.23.6.-h,--hashhash-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 sincedpkg 1.17.14.-m,--multiversionβ include all the packages it found in the output. no dedup, no drama, all of them π-M,--mediumid-stringβ add anX-Mediumfield containing the valueid-string. this field is required if you want to generatePackages.cdfiles for use by the media access method ofdselect. supported sincedpkg 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),alwaysandnever. supported sincedpkg 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:0and1(the default). supported sincedpkg 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
Filenamefield 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
- 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