In the Debian system to replace with domestic sources, you can follow the steps below:
- Back up the source list file: First, back up the current source list file by opening a terminal and running the following command as an administrator:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
- Edit the source listing file: Open the source listing file with a text editor such as nano or vim:
sudo nano /etc/apt/sources.list
- Replace with domestic source: Replace the contents of the file with the appropriate domestic source for your region. Here are some examples of commonly used domestic sources:
- Aliyun source:
deb http://mirrors.aliyun.com/debian/ buster main contrib non-free
deb-src http://mirrors.aliyun.com/debian/ buster main contrib non-free
deb http://mirrors.aliyun.com/debian-security/ buster/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security/ buster/updates main contrib non-free
deb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free
deb http://mirrors.aliyun.com/debian/ buster-backports main contrib non-free
deb-src http://mirrors.aliyun.com/debian/ buster-backports main contrib non-free
- Tsinghua University source:
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
- Save and close the file. Then, run the following command to update the package cache:
sudo apt update
Now, your Debian system has been replaced with a domestic source. Using a domestic source can speed up package downloads and provide a more stable connection. Note that depending on your region and specific needs, choose the appropriate source for you.