LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

netselect-apt

Automatically find the fastest Debian mirror and create sources.list

TLDR

Create sources.list using the fastest mirror
$ sudo netselect-apt
copy
Specify Debian distribution (default is stable)
$ sudo netselect-apt [testing]
copy
Include non-free section
$ sudo netselect-apt -n
copy
Limit mirrors to a specific country
$ sudo netselect-apt -c [India]
copy
Include deb-src lines for source packages
$ sudo netselect-apt -s
copy
Write output to a custom file
$ sudo netselect-apt -o [/etc/apt/sources.list]
copy
Use a specific architecture
$ sudo netselect-apt -a [amd64]
copy

SYNOPSIS

netselect-apt [options] [distribution]

DESCRIPTION

netselect-apt automatically finds the fastest Debian mirror and generates an appropriate sources.list file. It downloads the official Debian mirror list, optionally filters by country, tests each server for latency using netselect, and creates a sources.list with the fastest mirror.This is particularly useful when setting up new Debian systems or when experiencing slow package downloads from the default mirror.

PARAMETERS

-a, --arch arch

Use mirrors containing the specified architecture. Defaults to the architecture reported by dpkg.
-c, --country name
Limit mirror selection to a specific country (ISO-3166 code or full English name).
-f, --ftp
Use FTP mirrors instead of HTTP.
-n, --non-free
Include non-free section in the generated sources.list.
-o, --outfile file
Write output to the specified file instead of sources.list.
-s, --sources
Include deb-src lines for source packages.
-t, --tests num
Number of hosts to test for mirror validity (default 10).
-i, --infile file
Use a local mirror list file instead of downloading one. Must be in mirrors_full format.
distribution
Debian release name: stable, testing, unstable, experimental, or a codename (e.g. bookworm, trixie). Default is stable.

INSTALL

sudo apt install netselect
copy
nix profile install nixpkgs#netselect
copy

CAVEATS

Requires root privileges for ICMP network testing. Network conditions vary over time; run periodically to find the currently optimal mirror. The generated sources.list should be reviewed before replacing the system file. Mirror latency may not reflect actual download speed for large files.

SEE ALSO

netselect(1), apt(8), apt-get(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid