{
    "mode": "man",
    "parameter": "dpkg-scanpackages",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/dpkg-scanpackages/1/json",
    "generated": "2026-09-01T22:13:45Z",
    "synopsis": "dpkg-scanpackages [option...] binary-path [override-file [path-prefix]] > Packages",
    "sections": {
        "NAME": {
            "content": "dpkg-scanpackages - create Packages index files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "dpkg-scanpackages [option...] binary-path [override-file [path-prefix]] > Packages\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "dpkg-scanpackages sorts through a tree of Debian binary packages and creates a Packages file,\nused by apt(8), dselect(1), etc, to tell the user what packages are available for\ninstallation.  These Packages files are the same as those found on Debian archive sites and\nmedia discs.  You might use dpkg-scanpackages yourself if making a directory of local\npackages to install on a cluster of machines.\n\nNote: If you want to access the generated Packages file with apt(8) you will probably need to\ncompress the file with xz(1) (generating a Packages.xz file), bzip2(1) (generating a\nPackages.bz2 file) or gzip(1) (generating a Packages.gz file).  apt(8) ignores uncompressed\nPackages files except on local access (i.e.  file:// sources).\n\nbinary-path is the name of the tree of the binary packages to process (for example,\ncontrib/binary-i386).  It is best to make this relative to the root of the Debian archive,\nbecause every Filename field in the new Packages file will start with this string.\n\noverride-file is the name of a file to read which contains information about how the package\nfits into the distribution (the file can be compressed since dpkg 1.15.5); see\ndeb-override(5).\n\npath-prefix is an optional string to be prepended to the Filename fields.\n\nIf more than one version of a package is found only the newest one is included in the output.\nIf they have the same version and only differ in architecture only the first one found is\nused.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-t --type _",
                    "content": "Scan for *.type packages, instead of *.deb.\n",
                    "flag": "-t",
                    "long": "--type"
                },
                {
                    "name": "-e --extra-override _",
                    "content": "Scan file to find supplementary overrides (the file can be compressed since dpkg 1.15.5).\nSee deb-extra-override(5) for more information on its format.\n",
                    "flag": "-e",
                    "long": "--extra-override"
                },
                {
                    "name": "-a --arch _",
                    "content": "Use a pattern consisting of *all.deb and *arch.deb instead of scanning for all debs.\n",
                    "flag": "-a",
                    "long": "--arch"
                },
                {
                    "name": "-h --hash _",
                    "content": "Only  generate  file  hashes for the comma-specified list specified (since dpkg 1.17.14).\nThe default is to generate all currently supported hashes.  Supported values: md5,  sha1,\nsha256.\n",
                    "flag": "-h",
                    "long": "--hash"
                },
                {
                    "name": "-m --multiversion",
                    "content": "Include all found packages in the output.\n",
                    "flag": "-m",
                    "long": "--multiversion"
                },
                {
                    "name": "-M --medium _",
                    "content": "Add  an X-Medium field containing the value id-string (since dpkg 1.15.5).  This field is\nrequired if you want to generate Packages.cd files for use by the media access method  of\ndselect.\n\n-?, --help\nShow the usage message and exit.\n",
                    "flag": "-M",
                    "long": "--medium"
                },
                {
                    "name": "--version",
                    "content": "Show the version and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "DPKGCOLORS\nSets  the  color  mode  (since  dpkg  1.18.5).   The  currently accepted values are: auto\n(default), always and never.\n\nDPKGNLS\nIf set, it will be used to decide whether to activate Native Language Support, also known\nas internationalization (or i18n) support (since dpkg 1.19.0).  The accepted values  are:\n0 and 1 (default).\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "dpkg-scanpackages  outputs  the  usual self-explanatory errors.  It also warns about packages\nthat are in the wrong subdirectory, are duplicated, have a Filename field  in  their  control\nfile,  are missing from the override file, or have maintainer substitutions which do not take\neffect.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "dpkg(1), dselect(1), deb-override(5), deb-extra-override(5), dpkg-scansources(1).\n\n1.22.6                                       2026-05-06                         dpkg-scanpackages(1)",
            "subsections": []
        }
    },
    "summary": "dpkg-scanpackages - create Packages index files",
    "flags": [
        {
            "flag": "-t",
            "long": "--type",
            "arg": null,
            "description": "Scan for *.type packages, instead of *.deb."
        },
        {
            "flag": "-e",
            "long": "--extra-override",
            "arg": null,
            "description": "Scan file to find supplementary overrides (the file can be compressed since dpkg 1.15.5). See deb-extra-override(5) for more information on its format."
        },
        {
            "flag": "-a",
            "long": "--arch",
            "arg": null,
            "description": "Use a pattern consisting of *all.deb and *arch.deb instead of scanning for all debs."
        },
        {
            "flag": "-h",
            "long": "--hash",
            "arg": null,
            "description": "Only generate file hashes for the comma-specified list specified (since dpkg 1.17.14). The default is to generate all currently supported hashes. Supported values: md5, sha1, sha256."
        },
        {
            "flag": "-m",
            "long": "--multiversion",
            "arg": null,
            "description": "Include all found packages in the output."
        },
        {
            "flag": "-M",
            "long": "--medium",
            "arg": null,
            "description": "Add an X-Medium field containing the value id-string (since dpkg 1.15.5). This field is required if you want to generate Packages.cd files for use by the media access method of dselect. -?, --help Show the usage message and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Show the version and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "dpkg",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg/1/json"
        },
        {
            "name": "dselect",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dselect/1/json"
        },
        {
            "name": "deb-override",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-override/5/json"
        },
        {
            "name": "deb-extra-override",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-extra-override/5/json"
        },
        {
            "name": "dpkg-scansources",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-scansources/1/json"
        }
    ],
    "tldr": {
        "source": "not_found",
        "examples": []
    }
}