NETSELECT-APT(1)

πŸ“¦
version 0.3.ds1 Β· 2 versions
, in debian bookworm, debian trixie

πŸ’– 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:

  1. downloads the list of Debian mirrors using wget 🫢
  2. picks the fastest servers using netselect ⚑
  3. 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: if netselect is not installed setuid, then netselect-apt needs to run as an administrator user (i.e. root). the only reason it needs that is because the network probes that netselect does 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, stable is used. main character default fr.
  • -a, --arch ARCH β€” use mirrors containing ARCH. by default it uses the architecture of the current machine, as reported by dpkg πŸ’»
  • -s, --sources β€” while generating OUTFILE, also include deb-src lines so you can use apt-get source to grab Debian source packages. for the girlies who read the source πŸ“–
  • -i, --infile INFILE β€” use INFILE instead of downloading the mirror list to a temporary file. the file must be in the same format as mirrors_full. don't freestyle the format, bestie πŸ™ˆ
  • -o, --outfile OUTFILE β€” use OUTFILE instead of sources.list. name it whatever you want ✨
  • -n, --nonfree β€” also include the non-free section while generating OUTFILE.
  • -f, --ftp β€” use FTP mirrors instead of HTTP, and generate OUTFILE accordingly.
  • -O OPTIONS β€” whatever OPTIONS you give here get added, verbatim, to netselect when it runs. this is your spot to hand it a (quoted) list of options for netselect. periodt.
  • -t, --tests hosts β€” 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, --country COUNTRY β€” 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 to 1 is equivalent to --sources πŸ“
  • WANT_NONFREE β€” setting this to 1 is 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