Debian-更换软件源/升级Cloud内核

2021年04月07日 · Linux · 87次阅读

1.备份原软件源

cp /etc/apt/sources.list /etc/apt/sources.list.backup

2.修改软件源

vim /etc/apt/sources.list

3.删除 sources.list 中的记录,添加以下记录。

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

4.更新

apt update && apt upgrade -y


更换cloud内核

安装所需依赖
apt install -y lsb-release

添加 Backports 源

cat >> /etc/apt/sources.list.d/backports.list << EOF
deb http://deb.debian.org/debian $(lsb_release -sc)-backports main 
EOF

国内可考虑使用中科大的源

cat >> /etc/apt/sources.list.d/backports.list << EOF
deb https://mirrors.ustc.edu.cn/debian $(lsb_release -sc)-backports main 
EOF

执行升级

apt -t $(lsb_release -sc)-backports update && apt -y -t $(lsb_release -sc)-backports upgrade

注:更新的同时可能会自动更新新内核,可重启后卸载掉

安装内核

apt -t $(lsb_release -sc)-backports install linux-image-cloud-amd64 linux-headers-cloud-amd64

安装成功后重启即可食用,可使用 uname -r 查看内核是否安装成功

卸载原来内核

dpkg -l | grep linux-image
apt-get purge xxx


验证Google BBR开启和关闭

先查看内核版本

uname -a
#再检查net的返回参数一般为:bbr cubic reno 或者 reno cubic bbr
sysctl net.ipv4.tcp_congestion_control  
 
#返回值:net.ipv4.tcp_congestion_control = bbr
sysctl net.ipv4.tcp_congestion_control
 
#返回值:net.core.default_qdisc = fq
sysctl net.core.default_qdisc
关闭Google BBR

同理,关闭Google BBR,把对应参数改掉即可

vim /etc/sysctl.conf
 
#用#注释掉:
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
 
sysctl -p

标签:none

最后编辑于:2021-05-03 01:29