或许真的到了放弃centos7的时间了

或许真的到了放弃centos7的时间了。

今天折腾mdBook Rust,然后发现竟然不支持centos7 原因是GLIBC太老了 但是GLIBC 和系统核心相关,升级的话 还是非常麻烦

只好尝试升级到Centos Stream 8

其实很想用archlinux,但

安装epel-relase、yum-utils和rpmconf

1
2
yum install yum-utils epel-release -y
yum install rpmconf -y

安装前检查

1
2
3
rpmconf -a
package-cleanup --leaves
package-cleanup --orphans

安装dnf 并执行更新

1
2
3
4
5
yum install dnf -y
dnf remove yum yum-metadata-parser -y && rm -rf /etc/yum
dnf upgrade -y
dnf upgrade https://mirrors.bfsu.edu.cn/centos-vault/8.0.1905/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm -y
dnf upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y

删除无用文件、CentOS 7的内核、更换Vault源和移除无法升级的包并安装CentOS 8的内核

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dnf clean all
rpm -e `rpm -q kernel`
rpm -e --nodeps sysvinit-tools
minorver=8.0.1905
sudo sed -e "s|^mirrorlist=|#mirrorlist=|g" \
         -e "s|^#baseurl=http://mirror.centos.org/\$contentdir/\$releasever|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/$minorver|g" \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo
dnf remove python36-rpmconf -y
dnf --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync -y
dnf groupupdate "Core" "Minimal Install" -y

升级到Centos Stream 8

1
2
3
4
5
6
dnf install \
    http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-4.el8.noarch.rpm \
    http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-release-8.6-1.el8.noarch.rpm \
    http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-4.el8.noarch.rpm \
    -y
dnf distro-sync --allowerasing -y

最后清理dnf 然后更新

1
2
dnf clean packages
reboot

进入系统后 再更新一次

1
dnf update

后面还需要大量工作要处理,如果不是非常必要,建议直接重装

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计