改变Debian的镜像源主要是为了加快软件包的下载速度或使用国内更稳定的镜像源。以下是改变Debian镜像源的步骤:
对于Debian 10 (Buster)及以后版本:
1. 打开终端。
2. 输入以下命令来编辑`/etc/apt/sources.list`文件:
```bash
sudo nano /etc/apt/sources.list
```
3. 删除文件中的所有内容,并替换为新的镜像源地址。以下是一些常用的国内镜像源:
清华大学:`deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free`
163:`deb http://mirrors.163.com/debian/ buster main contrib non-free`
网易:`deb http://mirrors.163.com/debian/ buster main contrib non-free`
中科大:`deb http://mirrors.ustc.edu.cn/debian/ buster main contrib non-free`
4. 保存并关闭文件(在nano编辑器中按`Ctrl+O`保存,然后按`Ctrl+X`退出)。
5. 更新源列表:
```bash
sudo apt update
```
对于Debian 9 (Stretch):
1. 打开终端。
2. 输入以下命令来编辑`/etc/apt/sources.list`文件:
```bash
sudo nano /etc/apt/sources.list
```
3. 删除文件中的所有内容,并替换为新的镜像源地址。以下是一些常用的国内镜像源:
清华大学:`deb http://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free`
163:`deb http://mirrors.163.com/debian/ stretch main contrib non-free`
网易:`deb http://mirrors.163.com/debian/ stretch main contrib non-free`
中科大:`deb http://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free`
4. 保存并关闭文件(在nano编辑器中按`Ctrl+O`保存,然后按`Ctrl+X`退出)。
5. 更新源列表:
```bash
sudo apt update
```
对于Debian 8 (Jessie):
1. 打开终端。
2. 输入以下命令来编辑`/etc/apt/sources.list`文件:
```bash
sudo nano /etc/apt/sources.list
```
3. 删除文件中的所有内容,并替换为新的镜像源地址。以下是一些常用的国内镜像源:
清华大学:`deb http://mirrors.tuna.tsinghua.edu.cn/debian/ jessie main contrib non-free`
163:`deb http://mirrors.163.com/debian/ jessie main contrib non-free`
网易:`deb http://mirrors.163.com/debian/ jessie main contrib non-free`
中科大:`deb http://mirrors.ustc.edu.cn/debian/ jessie main contrib non-free`
4. 保存并关闭文件(在nano编辑器中按`Ctrl+O`保存,然后按`Ctrl+X`退出)。
5. 更新源列表:
```bash
sudo apt update
```
完成以上步骤后,Debian的镜像源就替换为新的镜像源了。