debian更换163源

1.首先先备份原文件

mv /etc/apt/sources.list /etc/apt/sources.listbak

2.以Jessie为例, 编辑/etc/apt/sources.list文件, 在文件最前面添加以下条目

deb http://mirrors.163.com/debian/ jessie main non-free contrib

deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib

deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib

deb-src http://mirrors.163.com/debian/ jessie main non-free contrib

deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib

deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib

deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

3.如需换成其他版本只要将jessie换成相应版本号即可,可用sed命令:

```

sed -i "s/jessie/buster/g" /etc/apt/sources.list

```

之后再apt update就OK了

你可能感兴趣的:(debian更换163源)