NETSELECT-APT(1)
π NETSELECT-APT β the netselect-apt(1) glow-up π
okay bestie, sit down, hydrate, and let me tell you about netselect-apt β it's the little tool that goes out into the Debian mirror wilderness and comes back with the fastest ones so your apt stops crawling. this is from the General Commands Manual section of the manual pages, and it's genuinely iconic. let's get into it π¦
β¨ NAME β¨
netselect-apt β makes you a sources.list for the fastest Debian mirrors π
β¨ SYNOPSIS β¨
netselect-apt [OPTIONS]
[stable|testing|unstable|experimental|release_codename|sid]
β¨ DESCRIPTION β¨
so basically netselect-apt just automatically creates a sources.list file for you to use with apt for whichever distribution you asked for. the whole pipeline is:
- downloads the list of Debian mirrors using
wgetπ«Ά - picks the fastest servers using
netselectβ‘ - tests the valid servers using
curl(if it's available) π
and then the output file gets written to OUTFILE. slay.
the way it figures out the fastest servers? it checks through netselect, and whichever servers respond faster to ICMP queries win. and to figure out whether those servers are actually valid, it makes a connection using the specified protocol (HTTP or FTP) with curl. no cap.
heads up bestie: ifnetselectis not installed setuid, thennetselect-aptneeds to run as an administrator user (i.e. root). the only reason it needs that is because the network probes thatnetselectdoes require those permissions. and no worries β no changes are done to the system. it's just vibes and probes π
and ooh, here's a good one: if you pass -i INFILE, then netselect-apt uses that instead of downloading another copy to a temporary file. the file gets downloaded from http://www.debian.org/mirror/mirrors_full πΈ
β¨ OPTIONS β¨
stable|testing|unstable|experimental|release_codename|sidβ tell it which distribution of Debian to use. by default,stableis used. main character default fr.-a,--archARCH β use mirrors containing ARCH. by default it uses the architecture of the current machine, as reported bydpkgπ»-s,--sourcesβ while generatingOUTFILE, also includedeb-srclines so you can useapt-get sourceto grab Debian source packages. for the girlies who read the source π-i,--infileINFILE β use INFILE instead of downloading the mirror list to a temporary file. the file must be in the same format asmirrors_full. don't freestyle the format, bestie π-o,--outfileOUTFILE β use OUTFILE instead ofsources.list. name it whatever you want β¨-n,--nonfreeβ also include thenon-freesection while generatingOUTFILE.-f,--ftpβ use FTP mirrors instead of HTTP, and generateOUTFILEaccordingly.-OOPTIONS β whatever OPTIONS you give here get added, verbatim, tonetselectwhen it runs. this is your spot to hand it a (quoted) list of options fornetselect. periodt.-t,--testshosts β make a short list with the number of hosts provided, and use that list to test for mirror validity. by default 10 hosts are tested.-c,--countryCOUNTRY β only test the sites found under the country COUNTRY. the value can either be an ISO-3166 value or the full name of the language, in English. when this is set, the mirror list (or the INFILE) gets filtered, and only the sites listed under that country get tested.
β οΈ real talk: restricting the search might not give you the best results, because the "fastest" mirror might not even be in the same country as the system this program is running on. don't limit yourself, babe π
β¨ ENVIRONMENT β¨
WANT_SOURCESβ setting this to1is equivalent to--sourcesπWANT_NONFREEβ setting this to1is equivalent to--nonfreeπ
β¨ LIMITATIONS β¨
okay this is the part where we keep it real, because these are important π
netselect-apt is unable to work with restricted environments where network filtering is implemented, because it relies on netselect being able to find a suitable mirror. for that to happen, the system where the script runs needs to have network visibility of the mirrors, since it will probe them using ICMP probes. so if your network says no, the tool says no. π
it's also unable to work in environments where HTTP or FTP network connections have to be done through a proxy host, because it relies on being able to test the validity of the remote mirrors by doing direct network connections to them. no proxy glow-up available, sorry π₯²
and the biggest one: netselect-apt will not check if the mirror it suggests as the "fastest" mirror is either valid or up-to-date. it is recommended that users who use this tool also validate that the mirrors suggested are official mirrors and are also current. so likeβ¦ trust but verify, bestie. do your own vibe check π
β¨ SEE ALSO β¨
netselect(1), wget(1), curl(1), apt(8), sources.list(5).
for Debian GNU/Linux it is recommended that users review the official mirror list at http://www.debian.org/mirror/official as well as the mirror checker tool at http://mirror.debian.org/status.html (which provides information on the up-to-dateness status of mirrors). go peek, it's giving responsible π
β¨ AUTHOR β¨
Avery Pennarun <apenwarr@gmail.com>
this manual page and program have been also enhanced by Filippo Giunchedi <filippo@esaurito.net> and Javier Fernandez-Sanguino <jfs@debian.org> π
and that's the whole page, bestie!! π this one came out of the DEBIAN corner of the world, dated March 6, 2008, and it's filed under the manual page name NETSELECT-APT(1) β go forth and pick a fast mirror, you've got this π«Άβ¨
π¦ where this page comes from
- debian bookworm: netselect-apt 0.3.ds1-30.1
- debian trixie: netselect-apt 0.3.ds1-31 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms