停止支持后更换/修复YUM源错误并启用BBR


centos Linux 7 的生命周期(EOL)已经于 2024 年 6 月 30 日终止。官方不再为其提供yum源,以及系统、软件安全更新,其存在严重安全隐患!我们强烈建议使用维护周期更长的DebianUbuntu,如果希望继续使用centos也建议升级到centos Stream。

对于仍然希望临时使用centos7以及等待软件完成兼容的客户,您可以复制以下命令,整个粘贴到系统执行,即可更换/修复yum安装软件或更新错误。以下命令会将yum源替换到阿里云(其速度可能存在限速),同时开启BBR,以提高TCP网络速度。

# Update apt sources  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup  wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo  sudo yum clean all  sudo yum makecache  sudo yum update -y  sudo yum upgrade -y  sudo yum autoremove -y    # Elrepo  rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org  yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm -y  yum --enablerepo=elrepo-kernel install kernel-ml -y  grub2-set-default 0  yum install yum-utils -y  package-cleanup --oldkernels --count=1    # Configure sysctl settings  cat > /etc/sysctl.d/custom.conf << EOF  net.ipv4.tcp_ecn = 1  net.core.default_qdisc = fq  net.ipv4.tcp_congestion_control = bbr  EOF    sudo reboot

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享