debian 国内源
<p>网易163:http://mirrors.163.com/.help/debian.html</p> <p>使用方法:</p> <div class="cnblogs_code" style="border: 1px solid rgba(204, 204, 204, 1); padding: 5px; background-color: rgba(245, 245, 245, 1)"><pre><span style="color: rgba(0, 0, 255, 1)">echo</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">deb http://mirrors.163.com/debian/ stretch main non-free contrib \</span>deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ stretch-updates main non-free contrib \</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ stretch-backports main non-free contrib \</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ stretch main non-free contrib \</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ stretch-updates main non-free contrib \</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ stretch-backports main non-free contrib \</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian-security/ stretch/updates main non-free contrib \</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian-security/ stretch/updates main non-free contrib" > /etc/apt/sources.list</span></pre></div>
</div>
<div id="MySignature" role="contentinfo">
<hr>
<span style="color: grey">输了你,赢了世界又如何...</span><br><br>
来源:https://www.cnblogs.com/xwgli/p/13346102.html 感谢楼主分享!不过友情提醒一下,帖子里的 stretch 是 Debian 9 的代号,官方早就停止维护啦。现在稳定版已经是 bookworm(Debian 12),建议把源里的版本号直接替换成 stable 或者 bookworm,这样以后大版本升级也不用反复改配置文件。
另外原帖的 echo 命令直接复制到终端容易因为引号和换行符报错,我平时习惯用下面这种更稳妥的写法,直接覆盖写入不怕出错:
sudo tee /etc/apt/sources.list << 'EOF'
deb https://mirrors.aliyun.com/debian/ stable main contrib non-free
deb https://mirrors.aliyun.com/debian/ stable-updates main contrib non-free
deb https://mirrors.aliyun.com/debian/ stable-backports main contrib non-free
deb-src https://mirrors.aliyun.com/debian/ stable main contrib non-free
deb-src https://mirrors.aliyun.com/debian/ stable-updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian/ stable-backports main contrib non-free
EOF
国内除了网易163,阿里云 和 清华源 的同步速度和稳定性都很顶,大家可以根据自己运营商挑一个。换完源千万记得跑一下 sudo apt update 刷新缓存~ 配置过程中遇到依赖冲突或者签名报错随时回帖,咱们一起排查!祝折腾顺利,玩得开心! 感谢楼主和二楼的干货补充,给大家补点新手向的小Tips和其他热门源~
首先改源之前千万记得先备份原配置,万一写错了也能一键回滚:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
另外Debian12开始新增了non-free-firmware固件源,很多小伙伴第一次装容易漏,导致网卡显卡这类硬件驱动不生效,给大家贴个清华源的完整bookworm配置,亲测不管是教育网还是家用宽带速度都很稳:
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
顺便补充下二楼说的用stable代替版本号的注意点哦:如果是个人用想要一直跟进最新稳定版可以这么写,要是生产环境或者怕大版本升级出兼容问题的话,还是建议固定写具体的版本代号更稳妥,避免下次Debian发新版的时候不小心直接升到大版本踩坑。
改完源之后记得执行sudo apt update
刷新缓存才会生效哈~
頁:
[1]