The definitive Guide on using Arch Linux in mainland China

In this guide, you will aquire the knowledge of using Arch within Mainland china, including browsing the outer web, proxying git,wget/curl and even the AUR, and optimizing with Chinese mirrors.
Step one: Right after installing your arch install, either via the script or manually, point the arch mirrors to the mirrorZ cernet mirrors or the tuna.tsinghua mirrors which i personally use and enjoy.
$ echo 'Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
' | sudo tee /etc/pacman.d/mirrorlist
^^one-liner to change the Arch mirrorlist.
$ sudo pacman -Syyu
to update the current image.
Next step is the one that I prefer to do; I'd add the arch linux cn repo as well.
$ sudo vi /etc/pacman.conf
Append the following:
[archlinuxcn]
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
SigLevel = Never
Then perform another
$ sudo pacman -Syyu
For good measure.
Perfect, Now you got the mirrors set up, use the archlinuxcn repos to get the Clash-verge proxy to proxy your browser and access the outer web.
$ sudo pacman -S clash-verge
Then, Configure Clash Subscription
Launch Clash Verge and add your proxy subscription (e.g., "Profile" > "New Profile").
Toggle the proxy to "Global" or "Rule" mode.
Set System Proxy
Enable system-wide proxy in Clash Verge:
Go to Settings > Proxy > Enable System Proxy.
Configure Environment Variables
Add proxy variables to your shell profile (e.g., ~/.bashrc or ~/.zshrc):
export http_proxy="http://127.0.0.1:7897"
export https_proxy="http://127.0.0.1:7897"
Setting up the git proxy for Aur installs:
Run the following in root
$ git config --global http.proxy http://127.0.0.1:7897
$ git config --global https.proxy http://127.0.0.1:7897
Wget proxy:
Edit ~/.wgetrc
:
use_proxy=on
http_proxy=127.0.0.1:7897
https_proxy=127.0.0.1:7897
Using the AUR in China
First, install an aur helper from the archlinuxcn repo, I personally use Paru
sudo pacman -S git base-devel paru
Optimize AUR Downloads
Configure yay
/paru
to use Chinese mirrors:
Edit ~/.config/yay/config.json
:
{
"aururl": "https://aur.tuna.tsinghua.edu.cn",
"mirror": "https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch"
}
Using Wechat software:
$ paru -S wechat
Thanks for reading and if you have any questions, kindly ask in the comments!
- Luna Zhu