APT-FTPARCHIVE(1)
๐ APT-FTPARCHIVE(1) ๐
okay bestie, welcome to the apt-ftparchive manual page โ section 1, from the APT crew. this is the one that makes index files, and yes it's lowkey iconic. ๐ซถ
๐ธ NAME ๐ธ
apt-ftparchive โ utility to generate index files โจ
๐ฆ SYNOPSIS ๐ฆ
apt-ftparchive [-dsq] [--md5] [--delink] [--readonly] [--contents]
[--arch architecture] [-o=config_string] [-c=config_file]
{packages path [override-file [pathprefix]] |
sources path [override-file [pathprefix]] |
contents path | release path |
generate config_file section... | clean config_file |
{-v | --version} | {-h | --help}}
โจ DESCRIPTION โจ
apt-ftparchive is the command line tool that generates the index files APT uses to access a distribution source. The index files should be generated on the origin site based on the content of that site. ๐
apt-ftparchive is a superset of the dpkg-scanpackages(1) program, incorporating its entire functionality via the packages command. It also contains a contents file generator, contents, and an elaborate means to 'script' the generation process for a complete archive.
Internally apt-ftparchive can make use of binary databases to cache the contents of a .deb file and it does not rely on any external programs aside from gzip(1). When doing a full generate it automatically performs file-change checks and builds the desired compressed output files. no cap, that's the internal vibe. ๐ฅ
Unless the -h, or --help option is given, one of the commands below must be present.
๐ the commands, bestie ๐
packages ๐ฆ
The packages command generates a package file from a directory tree. It takes the given directory and recursively searches it for .deb files, emitting a package record to stdout for each. This command is approximately equivalent to dpkg-scanpackages(1).
The option --db can be used to specify a binary caching DB.
sources ๐ง
The sources command generates a source index file from a directory tree. It takes the given directory and recursively searches it for .dsc files, emitting a source record to stdout for each. This command is approximately equivalent to dpkg-scansources(1).
If an override file is specified then a source override file will be looked for with an extension of .src. The --source-override option can be used to change the source override file that will be used.
contents ๐
The contents command generates a contents file from a directory tree. It takes the given directory and recursively searches it for .deb files, and reads the file list from each file. It then sorts and writes to stdout the list of files matched to packages. Directories are not written to the output. If multiple packages own the same file then each package is separated by a comma in the output.
The option --db can be used to specify a binary caching DB.
release ๐
The release command generates a Release file from a directory tree. It recursively searches the given directory for uncompressed and compressed Packages, Sources, Contents, Components and icons files as well as Release, Index and md5sum.txt files by default (APT::FTPArchive::Release::Default-Patterns). Additional filename patterns can be added by listing them in APT::FTPArchive::Release::Patterns. It then writes to stdout a Release file containing (by default) an MD5, SHA1, SHA256 and SHA512 digest for each file.
Values for the additional metadata fields in the Release file are taken from the corresponding variables under APT::FTPArchive::Release, e.g. APT::FTPArchive::Release::Origin. The supported fields are Origin, Label, Suite, Version, Codename, Date, NotAutomatic, ButAutomaticUpgrades, Acquire-By-Hash, Valid-Until, Signed-By, Architectures, Components and Description. ๐
generate โ๏ธ
The generate command is designed to be runnable from a cron script and builds indexes according to the given config file. The config language provides a flexible means of specifying which index files are built from which directories, as well as providing a simple means of maintaining the required settings.
clean ๐งผ
The clean command tidies the databases used by the given configuration file by removing any records that are no longer necessary.
๐ ๏ธ THE GENERATE CONFIGURATION ๐ ๏ธ
Okay so bestie, the generate command uses a configuration file to describe the archives that are going to be generated. It follows the typical ISC configuration format as seen in ISC tools like bind 8 and dhcpd. apt.conf(5) contains a description of the syntax. Note that the generate configuration is parsed in sectional manner, but apt.conf(5) is parsed in a tree manner. This only effects how the scope tag is handled.
The generate configuration has four separate sections, each described below.
๐ Dir Section ๐
The Dir section defines the standard directories needed to locate the files required during the generation process. These directories are prepended certain relative paths defined in later sections to produce a complete an absolute path.
ArchiveDirโ specifies the root of the FTP archive; in a standard Debian configuration this is the directory that contains thels-LRanddistnodes.OverrideDirโ specifies the location of the override files.CacheDirโ specifies the location of the cache files.FileListDirโ specifies the location of the file list files, if theFileListsetting is used below.
๐ธ Default Section ๐ธ
The Default section specifies default values, and settings that control the operation of the generator. Other sections may override these defaults with a per-section setting.
Packages::Compressโ sets the default compression schemes to use for the package index files. It is a string that contains a space separated list of at least one of the compressors configured via theAPT::Compressorconfiguration scope. The default for all compression schemes is'. gzip'.Packages::Extensionsโ sets the default list of file extensions that are package files. This defaults to.deb.Sources::Compressโ this is similar toPackages::Compressexcept that it controls the compression for the Sources files.Sources::Extensionsโ sets the default list of file extensions that are source files. This defaults to.dsc.Contents::Compressโ this is similar toPackages::Compressexcept that it controls the compression for the Contents files.Translation::Compressโ this is similar toPackages::Compressexcept that it controls the compression for theTranslation-enmaster file.DeLinkLimitโ specifies the number of kilobytes to delink (and replace with hard links) per run. This is used in conjunction with the per-sectionExternal-Linkssetting.FileModeโ specifies the mode of all created index files. It defaults to0644. All index files are set to this mode with no regard to the umask.LongDescriptionโ specifies whether long descriptions should be included in thePackagesfile or split out into a masterTranslation-enfile.
๐ฆ TreeDefault Section ๐ฆ
Sets defaults specific to Tree sections. All of these variables are substitution variables and have the strings $(DIST), $(SECTION) and $(ARCH) replaced with their respective values.
MaxContentsChangeโ sets the number of kilobytes of contents files that are generated each day. The contents files are round-robined so that over several days they will all be rebuilt.ContentsAgeโ controls the number of days a contents file is allowed to be checked without changing. If this limit is passed themtimeof the contents file is updated. This case can occur if the package file is changed in such a way that does not result in a new contents file [override edit for instance]. A hold off is allowed in hopes that new.debswill be installed, requiring a new file anyhow. The default is10, the units are in days.Directoryโ sets the top of the.debdirectory tree. Defaults to$(DIST)/$(SECTION)/binary-$(ARCH)/SrcDirectoryโ sets the top of the source package directory tree. Defaults to$(DIST)/$(SECTION)/source/Packagesโ sets the outputPackagesfile. Defaults to$(DIST)/$(SECTION)/binary-$(ARCH)/PackagesSourcesโ sets the outputSourcesfile. Defaults to$(DIST)/$(SECTION)/source/SourcesTranslationโ sets the outputTranslation-enmaster file with the long descriptions if they should be not included in thePackagesfile. Defaults to$(DIST)/$(SECTION)/i18n/Translation-enInternalPrefixโ sets the path prefix that causes a symlink to be considered an internal link instead of an external link. Defaults to$(DIST)/$(SECTION)/Contentsโ sets the outputContentsfile. Defaults to$(DIST)/$(SECTION)/Contents-$(ARCH). If this setting causes multiplePackagesfiles to map onto a singleContentsfile (as is the default) thenapt-ftparchivewill integrate those package files together automatically.Contents::Headerโ sets header file to prepend to the contents output.BinCacheDBโ sets the binary cache database to use for this section. Multiple sections can share the same database.FileListโ specifies that instead of walking the directory tree,apt-ftparchiveshould read the list of files from the given file. Relative files names are prefixed with the archive directory.SourceFileListโ specifies that instead of walking the directory tree,apt-ftparchiveshould read the list of files from the given file. Relative files names are prefixed with the archive directory. This is used when processing source indexes.
๐ Tree Section ๐
The Tree section defines a standard Debian file tree which consists of a base directory, then multiple sections in that base directory and finally multiple Architectures in each section. The exact pathing used is defined by the Directory substitution variable.
The Tree section takes a scope tag which sets the $(DIST) variable and defines the root of the tree (the path is prefixed by ArchiveDir). Typically this is a setting such as dists/trixie.
All of the settings defined in the TreeDefault section can be used in a Tree section as well as three new variables.
When processing a Tree section apt-ftparchive performs an operation similar to:
for i in Sections do
for j in Architectures do
Generate for DIST=scope SECTION=i ARCH=j
Sectionsโ this is a space separated list of sections which appear under the distribution; typically this is something likemain contrib non-free non-free-firmwareArchitecturesโ this is a space separated list of all the architectures that appear under search section. The special architecturesourceis used to indicate that this tree has a source archive. The architectureallsignals that architecture specific files likePackagesshould not include information about architecture all packages in all files as they will be available in a dedicated file.LongDescriptionโ specifies whether long descriptions should be included in thePackagesfile or split out into a masterTranslation-enfile.BinOverrideโ sets the binary override file. The override file contains section, priority and maintainer address information.SrcOverrideโ sets the source override file. The override file contains section information.ExtraOverrideโ sets the binary extra override file.SrcExtraOverrideโ sets the source extra override file.
โจ BinDirectory Section โจ
The bin directory section defines a binary directory tree with no special structure. The scope tag specifies the location of the binary directory and the settings are similar to the Tree section with no substitution variables or SectionArchitecture settings.
Packagesโ sets thePackagesfile output.Sourcesโ sets theSourcesfile output. At least one ofPackagesorSourcesis required.Contentsโ sets theContentsfile output (optional).BinOverrideโ sets the binary override file.SrcOverrideโ sets the source override file.ExtraOverrideโ sets the binary extra override file.SrcExtraOverrideโ sets the source extra override file.BinCacheDBโ sets the cache DB.PathPrefixโ appends a path to all the output paths.FileList,SourceFileListโ specifies the file list file.
๐ THE BINARY OVERRIDE FILE ๐
The binary override file is fully compatible with dpkg-scanpackages(1). It contains four fields separated by spaces. The first field is the package name, the second is the priority to force that package to, the third is the section to force that package to and the final field is the maintainer permutation field.
The general form of the maintainer field is:
old [// oldn]* => new
or simply,
new
The first form allows a double-slash separated list of old email addresses to be specified. If any of those are found then new is substituted for the maintainer field. The second form unconditionally substitutes the maintainer field.
๐ง THE SOURCE OVERRIDE FILE ๐ง
The source override file is fully compatible with dpkg-scansources(1). It contains two fields separated by spaces. The first field is the source package name, the second is the section to assign it.
๐ THE EXTRA OVERRIDE FILE ๐
The extra override file allows any arbitrary tag to be added or replaced in the output. It has three columns, the first is the package, the second is the tag and the remainder of the line is the new value.
๐ OPTIONS ๐
okay so literally every command line option here can also be set using the configuration file, and each description tells you which config option to set. For boolean options you can override the config file by using something like -f-,--no-f, -f=no or several other variations. iconic behavior, honestly ๐
--md5,--sha1,--sha256,--sha512,--sha3-256,--sha3-512โ generate the given checksum. These options default to on, when turned off the generated index files will not have the checksum fields where possible.--sha3-256and--sha3-512are the exception and default to off. Configuration Items:APT::FTPArchive::ChecksumandAPT::FTPArchive::Index::ChecksumwhereIndexcan bePackages,SourcesorReleaseandChecksumcan beMD5,SHA1,SHA256,SHA512,SHA3-256orSHA3-512. checksum girlies stay winning ๐ฅ-d,--dbโ use a binary caching DB. This has no effect on thegeneratecommand. Configuration Item:APT::FTPArchive::DB.-q,--quietโ quiet; produces output suitable for logging, omitting progress indicators. More q's will produce more quiet up to a maximum of 2. You can also use-q=#to set the quiet level, overriding the configuration file. Configuration Item:quiet. shhh bestie ๐คซ--delinkโ perform Delinking. If theExternal-Linkssetting is used then this option actually enables delinking of the files. It defaults to on and can be turned off with--no-delink. Configuration Item:APT::FTPArchive::DeLinkAct.--contentsโ perform contents generation. When this option is set and package indexes are being generated with a cache DB then the file listing will also be extracted and stored in the DB for later use. When using thegeneratecommand this option also allows the creation of anyContentsfiles. The default is on. Configuration Item:APT::FTPArchive::Contents.-s,--source-overrideโ select the source override file to use with thesourcescommand. Configuration Item:APT::FTPArchive::SourceOverride.--readonlyโ make the caching databases read only. Configuration Item:APT::FTPArchive::ReadOnlyDB.-a,--archโ accept in thepackagesandcontentscommands only package files matching*_arch.debor*_all.debinstead of all package files in the given path. Configuration Item:APT::FTPArchive::Architecture.APT::FTPArchive::AlwaysStatโapt-ftparchive(1)caches as much as possible of metadata in a cachedb. If packages are recompiled and/or republished with the same version again, this will lead to problems as the now outdated cached metadata like size and checksums will be used. With this option enabled this will no longer happen as it will be checked if the file was changed. Note that this option is set to "false" by default as it is not recommend to upload multiple versions/builds of a package with the same version number, so in theory nobody will have these problems and therefore all these extra checks are useless. it's giving "trust but verify" but make it apt โจAPT::FTPArchive::LongDescriptionโ this configuration option defaults to "true" and should only be set to "false" if the Archive generated withapt-ftparchive(1)also provides Translation files. Note that theTranslation-enmaster file can only be created in thegeneratecommand.-h,--helpโ show a short usage summary. help me help you ๐ซถ-v,--versionโ show the program version.--auditโ show audit (and notice) messages. This overrides the quiet option, but only for notice messages, not progress ones. not me being loud on purpose ๐-c,--config-fileโ Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with theAPT_CONFIGenvironment variable. Seeapt.conf(5)for syntax information.-o,--optionโ Set a Configuration Option; This will set an arbitrary configuration option. The syntax is-o Foo::Bar=bar.-oand--optioncan be used multiple times to set different options. stack those options like your fave accessories ๐--cli-versionโ Requests a specific CLI version. This is a pattern that takes aMAJOR.MINORversion. You may omit theMINORversion, in which case the latest supported minor level will be used. Version tracks are presented as follows: The version3.2has equivalent versions0.32,1.22, and2.12, implementing new features for their specified major versions. A special case is theX.9version pattern: A version like2.9is followed by3.0, but2.10follows directly on2.8; given that we use odd version numbers as development series (2.9is the3.0development series). This feature has been introduced in APT3.1.10, and replaces the binary-specific configuration. You may use theAPT::Versionto similar effect on older binaries, for example, use-o APT::Version=2to makeapt(8)behave like the2.xseries. The default value is the current APT version forapt(8)and0.(10 * major + minor)for the classic commands. The0.Xseries is soft-deprecated and the other commands will roll over to the2.xseries in the future. version lore fr fr ๐--no-color,--colorโ turn colors on or off. Colors are on by default on supported terminals forapt(8)and can also be disabled using theNO_COLORorAPT_NO_COLORenvironment variables, or further configured by theAPT::Colorconfiguration option and scope, seeapt.conf(5)for information on that. colorful terminal slay ๐
๐ธ EXAMPLES ๐ธ
To create a compressed Packages file for a directory containing binary packages (.deb):
apt-ftparchive packages directory | gzip > Packages.gz
look at that pipeline go. main character energy tbh ๐
๐ฆ SEE ALSO ๐ฆ
apt.conf(5)โ the config bestie, go read it.
โญ DIAGNOSTICS โญ
apt-ftparchive returns zero on normal operation, decimal 100 on error. bestie said "zero means we ate, 100 means something's not giving" ๐
๐ BUGS ๐
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.
๐ AUTHORS ๐
Jason Gunthorpe
APT team
๐ NOTES ๐
- APT bug page โ
https://bugs.debian.org/src:apt
and that's the whole page, bestie: APT 3.3.4, dated 28 September 2026, and it's APT-FTPARCHIVE(1). mwah ๐โจ
๐ฆ where this page comes from
- epel 10: apt-utils 3.3.4-1.el10_3 ยท GPL-2.0-or-later
- epel 9: apt-utils 3.3.4-1.el9 ยท 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