说明
XanMod 是一个通用的 Linux 内核发行版,集成了谷歌 BBR v3 TCP 拥塞算法,以及 Cloudflare 对 TCP 实现高吞吐低延迟的优化 tcp_collapse_max_bytes
等第三方补丁。
安装
一、安装 gpg
apt install gpg -y
二、注册 PGP 密钥
wget -qO - https://dl.xanmod.org/archive.key | sudo gpg --dearmor -vo /etc/apt/keyrings/xanmod-archive-keyring.gpg
注意:有些服务器执行上述命令,从 XanMod 下载密钥时,可能会下载失败。是因为你的服务器 IP 太脏了被 XanMod 服务器屏蔽了,只能手动通过浏览器下载密钥文件并上传到服务器。
三、添加存储库
echo 'deb [signed-by=/etc/apt/keyrings/xanmod-archive-keyring.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-release.list
四、刷新包
apt update
五、安装兼容版本
XanMod 有v1 v2 v3 v4 版本,需依据 CPU ISA(指令集架构)而选择合适的版本,我们可以通过官方提供的脚本来确认。
1.下载检测脚本
wget https://dl.xanmod.org/check_x86-64_psabi.sh
这里如果下载失败了,原因如步骤二所示,手动下载脚本到本地再上传到服务器。
2.赋予执行权限并执行
chmod +x check_x86-64_psabi.sh && ./check_x86-64_psabi.sh
3.结果显示
CPU supports x86-64-v3
版本为 x64-v3。
六、安装
apt install linux-xanmod-x64v3
重启
reboot
验证
验证内核版本
root@Cat:~# uname -a
Linux Cat 6.12.11-x64v3-xanmod1 #0~20250124.g892c1d8 SMP PREEMPT_DYNAMIC Fri Jan 24 01:24:06 UTC x86_64 GNU/Linux
检测 BBRv3
root@Cat:~# modinfo tcp_bbr
name: tcp_bbr
filename: (builtin)
version: 3
description: TCP BBR (Bottleneck Bandwidth and RTT)
license: Dual BSD/GPL
file: net/ipv4/tcp_bbr
author: David Morley <[email protected]>
author: Arjun Roy <[email protected]>
author: Kevin Yang <[email protected]>
author: Yousuk Seung <[email protected]>
author: Priyaranjan Jha <[email protected]>
author: Soheil Hassas Yeganeh <[email protected]>
author: Yuchung Cheng <[email protected]>
author: Neal Cardwell <[email protected]>
author: Van Jacobson <[email protected]>
结束
Have a nice day!
测试