Linux 装机必备 更新中
更换APT源
Debian 12.0
所有命令复制粘贴一起执行
替换官方源
cat > /etc/apt/sources.list << EOF
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF替换清华源
cat > /etc/apt/sources.list << EOF
deb 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 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-src 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-src 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-security/ bookworm-security main contrib non-free non-free-firmware
EOF替换中科大源
cat > /etc/apt/sources.list << EOF
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF替换腾讯云源
cat > /etc/apt/sources.list << EOF
deb https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF使用腾讯云服务器时,可以选择腾讯云内网源,走内网不消耗公网流量。
替换阿里云源
cat > /etc/apt/sources.list << EOF
deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF使用阿里云服务器时,可以选择腾讯云内网源,走内网不消耗公网流量。
替换为Linode源
Linode 不支持HTTPS
cat > /etc/apt/sources.list << EOF
deb http://mirrors.linode.com/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors.linode.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors.linode.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb http://mirrors.linode.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF更换完成源以后,执行命令更新apt索引
apt update更新、安装必备软件
apt-get update && apt-get install -y wget vim综合工具箱
wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh该工具箱集合非常多的脚本。
测试相关
机器测试
秋水的 bench.sh 脚本,这个脚本可以查看 Linux 系统信息,还可以测试网络带宽及硬盘读写速率。
wget -qO- bench.sh | bash单线程测试
bash <(curl -Lso- https://bench.im/hyperspeed)最全测试脚本
国内测试
bash <(curl -sL res.yserver.ink/taier.sh)curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast显示抖动、延迟
bash <(wget -qO- https://bench.im/hyperspeed)直接显示回程线路
wget -q route.f2k.pub -O route && bash route开启BBR
Debian 12开启BBR
BBR 主要是针对 TCP 流量进行优化,设计目的是提升整体网络性能,包括延迟和带宽质量。
首先把系统更新到最新版本
sudo apt update
sudo apt upgrade -y安装
Vim
sudo apt install vim -y打开
sysctl配置文件
sudo vim /etc/sysctl.conf编辑内容添加两行内容
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr保存好文件以后,使配置生效
sudo sysctl -p最后查询是否配置成功(返回包含BBR即可)
sysctl net.ipv4.tcp_congestion_control1Pnel 面板安装
bash -c "$(curl -sSL https://resource.fit2cloud.com/1panel/package/v2/quick_start.sh)"Docker安装
海外非大陆服务器
Docker安装
wget -qO- get.docker.com | bash卸载 Docker
sudo apt-get purge docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerdDocker-compose安装
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose授权 Docker-compose
sudo chmod +x /usr/local/bin/docker-compose查看 Docker-Compose 版本
docker-compose --version大陆服务器
安装 Docker
curl -fsSL https://bash.foreverlink.love/dockerinstall.sh | bash -s docker --mirror Aliyun卸载 Docker
sudo apt-get remove docker docker-engine
rm -fr /var/lib/docker/
- 感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 流川
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果

