If you are trying to install Arch Linux or its derivatives for the first time and you are in China, you are likely to feel desperate due to the slow download speed of the software sources. Within this vast country, network censorship and restrictions often cause significant troubles in the transmission of software packages. In such cases, your user experience is often very poor.
You can choose to change the mirror source, but when searching on search engines like Baidu, you often get quite troublesome methods, and you usually cannot directly determine whether the mirror source is the fastest in your area.
Today, I will introduce a fast method.
Prerequisites#
- You can use
pacman
to install software packages. - You have root privileges.
Method#
- Install
reflector
usingpacman
.
sudo pacman -S reflector
- Backup the
mirrorlist
(optional).
sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
- Test the speed and save the mirror sources.
sudo reflector --verbose -c China --latest 12 --sort rate --threads 100 --save /etc/pacman.d/mirrorlist
This command means using the reflector
tool to select 12
mirror sources from the Arch Linux mirror sites in China
, sort by rate
, perform the operation using 100
threads, and save the results to the file /etc/pacman.d/mirrorlist
.
Of course, you can also modify the parameters yourself.
4. Refresh the package list.
sudo pacman -Syy
Now you should be able to download software packages at a faster speed. If there are any errors during the download, you can retry the above operations.