← 返回命令列表

Linux command

netselect-apt 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Create sources.list using the fastest mirror

sudo netselect-apt

Specify Debian distribution (default is stable)

sudo netselect-apt [testing]

Include non-free section

sudo netselect-apt -n

Limit mirrors to a specific country

sudo netselect-apt -c [India]

Include deb-src lines for source packages

sudo netselect-apt -s

Write output to a custom file

sudo netselect-apt -o [/etc/apt/sources.list]

Use a specific architecture

sudo netselect-apt -a [amd64]

说明

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.

参数

-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.

FAQ

What is the netselect-apt command used for?

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.

How do I run a basic netselect-apt example?

Run `sudo netselect-apt` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --arch _arch_ do in netselect-apt?

Use mirrors containing the specified architecture. Defaults to the architecture reported by dpkg.