APT-SORTPKGS(1)
๐ APT-SORTPKGS ๐
okay so bestie, you know how package index files can be a whole mess? this little icon right here, apt-sortpkgs, is about to be your new bestie for fixing that. it lives in the APT family and honestly? it's giving "organized queen" energy. โจ
๐ธ SYNOPSIS ๐ธ
apt-sortpkgs [-s] [-o=config_string] [-c=config_file] filename...
{-v | --version} {-h | --help}
๐ฆ DESCRIPTION ๐ฆ
okay so picture this: you've got an index file (could be a source index or a package index, both slay) and it's just... vibing there in whatever order it wants. apt-sortpkgs takes that file and sorts the records by package name. lowkey iconic. ๐ฅ
but wait, there's more โ it also sorts the internal fields of each record according to the internal sorting rules. like, it doesn't just fix the outside, it fixes the inside too. self-care for your package index, fr fr. ๐
all output goes to standard output, bestie. and real talk: the input must be a seekable file. no cap. so pipe it from stdin and it simply won't work. you've been warned. ๐
โจ OPTIONS โจ
okay so here's the thing โ every single one of these command line options can also be set using the configuration file. the descriptions tell you which configuration option to set, iykyk.
and for boolean options? you can override the config file by using something like -f-,--no-f, -f=no or several other variations. so many options, it's giving "choose your own adventure". ๐
-s,--sourceโ use source index field ordering. configuration item:APT::SortPkgs::Source. simple as that, bestie. ๐ซถ-h,--helpโ shows a short usage summary. for when you're like "help me help me" and it's like "here's the basics". ๐ญ-v,--versionโ shows the program version. classic, iconic, no notes. ๐--auditโ show audit (and notice) messages. this one overrides the quiet option, but only for notice messages, not progress ones. very specific, very demure. ๐-c,--config-fileโ configuration file time! specify a config file to use. the program reads the default configuration file and then this configuration file. and listen โ 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 info. so much to know, but you got this. ๐-o,--optionโ set a configuration option, and honestly? it's giving "arbitrary power". the syntax is-o Foo::Bar=bar. and-oand--optioncan be used multiple times to set different options. stack 'em up, bestie. โญ--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 version 3.2 has equivalent versions 0.32, 1.22, and 2.12, implementing new features for their specified major versions.
special case alert ๐จ: the X.9 version pattern. a version like 2.9 is followed by 3.0, but 2.10 follows directly on 2.8 โ given that we use odd version numbers as development series (2.9 is the 3.0 development series). so don't get it twisted. ๐
this feature has been introduced in APT 3.1.10, and replaces the binary-specific configuration. you may use the APT::Version to similar effect on older binaries, for example, use -o APT::Version=2 to make apt(8) behave like the 2.x series.
the default value is the current APT version for apt(8) and 0.(10 * major + minor) for the classic commands. the 0.X series is soft-deprecated and the other commands will roll over to the 2.x series in the future. so heads up, bestie. ๐ข
--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. aesthetic choices are valid. ๐จ
๐ SEE ALSO ๐
apt.conf(5) โ the bestie you should also check out, no cap. ๐
๐ DIAGNOSTICS ๐
apt-sortpkgs returns zero on normal operation, decimal 100 on error. so if you see that 100, something went wrong and you should probably look into it. keeping it real. ๐
๐ 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. don't be shy, they actually want to hear from you. ๐
๐ง AUTHORS ๐ง
Jason Gunthorpe
APT team
like, legends only. respect. ๐ซก
๐ NOTES ๐
- APT bug page
https://bugs.debian.org/src:apt
and that's the whole page, bestie! written with ๐ by your favorite Unix bestie, based on APT 3.3.4 dated 30 November 2013 โ iconic since day one. periodt. โจ๐๐ฆ
๐ฆ 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