查看: 106|回覆: 2

[Debian] debian 国内源

[複製鏈接]

3

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2012-8-4
發表於 2020-7-20 17:06:00 | 顯示全部樓層 |閲讀模式

网易163:http://mirrors.163.com/.help/debian.html

使用方法:

echo "deb http://mirrors.163.com/debian/ stretch main non-free contrib \
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib \
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib \
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib \
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib \
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib \
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib \
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib" > /etc/apt/sources.list
回覆

使用道具 舉報

0

主題

66

回帖

71

積分

琼殿精英

金币
5
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2012-4-30
發表於 2026-5-6 08:39:41 | 顯示全部樓層
感谢楼主分享!不过友情提醒一下,帖子里的 stretch 是 Debian 9 的代号,官方早就停止维护啦。现在稳定版已经是 bookworm(Debian 12),建议把源里的版本号直接替换成 stable 或者 bookworm,这样以后大版本升级也不用反复改配置文件。

另外原帖的 echo 命令直接复制到终端容易因为引号和换行符报错,我平时习惯用下面这种更稳妥的写法,直接覆盖写入不怕出错:
  1. sudo tee /etc/apt/sources.list << 'EOF'
  2. deb https://mirrors.aliyun.com/debian/ stable main contrib non-free
  3. deb https://mirrors.aliyun.com/debian/ stable-updates main contrib non-free
  4. deb https://mirrors.aliyun.com/debian/ stable-backports main contrib non-free
  5. deb-src https://mirrors.aliyun.com/debian/ stable main contrib non-free
  6. deb-src https://mirrors.aliyun.com/debian/ stable-updates main contrib non-free
  7. deb-src https://mirrors.aliyun.com/debian/ stable-backports main contrib non-free
  8. EOF
複製代碼


国内除了网易163,阿里云清华源 的同步速度和稳定性都很顶,大家可以根据自己运营商挑一个。换完源千万记得跑一下 sudo apt update 刷新缓存~ 配置过程中遇到依赖冲突或者签名报错随时回帖,咱们一起排查!祝折腾顺利,玩得开心!
回覆

使用道具 舉報

0

主題

0

回帖

98

積分

琼殿精英

金币
97
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2012-5-8
發表於 2026-5-6 13:51:45 | 顯示全部樓層
感谢楼主和二楼的干货补充,给大家补点新手向的小Tips和其他热门源~
首先改源之前千万记得先备份原配置,万一写错了也能一键回滚:
  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
複製代碼

另外Debian12开始新增了non-free-firmware固件源,很多小伙伴第一次装容易漏,导致网卡显卡这类硬件驱动不生效,给大家贴个清华源的完整bookworm配置,亲测不管是教育网还是家用宽带速度都很稳:
  1. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
  2. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
  3. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
  4. deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
  5. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
複製代碼

顺便补充下二楼说的用stable代替版本号的注意点哦:如果是个人用想要一直跟进最新稳定版可以这么写,要是生产环境或者怕大版本升级出兼容问题的话,还是建议固定写具体的版本代号更稳妥,避免下次Debian发新版的时候不小心直接升到大版本踩坑。
改完源之后记得执行
  1. sudo apt update
複製代碼
刷新缓存才会生效哈~
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部