秋栈博客

七月

CentOS 8.X升级到CentOS 8 Stream

2
2022-08-14

查看系统版本、更换华为源

# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-8-reg.repo

Centos 8.3以下须先升级到8.5 ,再升级到Stream

  1. 注释mirrorlist
    sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo
  2. 指向baseurl至vault.epel.cloud存储库
    sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-*.repo
  3. 升级系统至Centos 8.5
    yum update -y

Centos 8.3+升级到Centos 8 Stream

  1. 第1步
    dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
  2. 第2步
    dnf distro-sync
  3. 重启系统
    reboot
  • 0