debian 9 更换源 使用国内源 配置方法

配置前请先参考:

https://wiki.debian.org/SourcesList
https://www.debian.org/mirror/list
https://mirrors.tuna.tsinghua.edu.cn/help/debian/
http://mirrors.ustc.edu.cn/help/debian.html

官方镜像地址:

ftp.cn.debian.org   #中科大
ftp2.cn.debian.org  #清华
nano /etc/apt/sources.list

deb http://ftp.cn.debian.org/debian stretch main
deb http://ftp.cn.debian.org/debian-security stretch/updates main
deb http://ftp.cn.debian.org/debian stretch-updates main

使用https地址,可以有效避免国内运营商的缓存劫持
以清华大学地址为例:

apt install apt-transport-https
nano /etc/apt/sources.list

deb https://mirrors.tuna.tsinghua.edu.cn/debian stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free
#backports请按需使用
#deb https://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports main contrib non-free 
#buster请按需使用
#deb https://mirrors.tuna.tsinghua.edu.cn/debian buster main

https://backports.debian.org

使用backports安装应用:

apt -t stretch-backports install ...

https://wiki.debian.org/DebianBuster

buster是debian 10的版本代号,配置buster源可以安装某些应用的最新版本,例如nano

原文地址:https://www.cnblogs.com/wswind/p/9881005.html