Centos7 更新到Rocky Linux8

Centos7已于2024年6月30日结束,我的这个Centos7主要是用来BT下载,没有什么重要的内容,如果你有更加重要的数据,一定要提前进行备份。

如果你要升级到Rocky Linux9,也需要先跟新到Rocky Linux8然后再升级到Rocky Linux9,不能越级升级

准备

Centos7由于已经结束了生命周期,因此需要自己更换yum源

# 备份
cd /etc/yum.repos.d/
mkdir repo_bak
mv *.repo repo_bak/

# 下载Centos7的repo文件
wget http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache

# 安装epel源
yum install -y epel-release

更新Centos 7

更新并查看当前系统版本

[root@localhost ~]# yum update -y

[root@localhost ~]# neofetch
                 ..                    root@localhost.localdomain 
               .PLTJ.                  -------------------------- 
              <><><><>                 OS: CentOS Linux 7 (Core) x86_64 
     KKSSV' 4KKK LJ KKKL.'VSSKK        Host: VMware Virtual Platform None 
     KKV' 4KKKKK LJ KKKKAL 'VKK        Kernel: 3.10.0-1160.el7.x86_64 
     V' ' 'VKKKK LJ KKKKV' ' 'V        Uptime: 1 min 
     .4MA.' 'VKK LJ KKV' '.4Mb.        Packages: 355 (rpm) 
   . KKKKKA.' 'V LJ V' '.4KKKKK .      Shell: bash 4.2.46 
 .4D KKKKKKKA.'' LJ ''.4KKKKKKK FA.    Terminal: /dev/pts/0 
<QDD ++++++++++++  ++++++++++++ GFD>   CPU: AMD Ryzen 7 5800X 8- (4) @ 3.792GHz 
 'VD KKKKKKKK'.. LJ ..'KKKKKKKK FV     GPU: 00:0f.0 VMware SVGA II Adapter 
   ' VKKKKK'. .4 LJ K. .'KKKKKV '      Memory: 423MiB / 7802MiB 
      'VK'. .4KK LJ KKA. .'KV'
     A. . .4KKKK LJ KKKKA. . .4                                
     KKA. 'KKKKK LJ KKKKK' .4KK                                
     KKSSA. VKKK LJ KKKV .4SSKK
              <><><><>
               'MKKM'
                 ''
[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)

安装工具

[root@localhost ~]# yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
[root@localhost ~]# yum install -y leapp-upgrade leapp-data-rocky

检查系统

这一部分出现的错误每台都不一样,这取决于你按照了多少软件包,安装的越多这一步需要修改的就越多

[root@localhost ~]# leapp preupgrade
# 报告路径在:/var/log/leapp/answerfile

我就遇到了下面错误

[root@localhost ~]# cat /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
# Title:              None
# Reason:             Confirmation
# =================== remove_pam_pkcs11_module_check.confirm ==================
# Label:              Disable pam_pkcs11 module in PAM configuration? If no, the upgrade process will be interrupted.
# Description:        PAM module pam_pkcs11 is no longer available in RHEL-8 since it was replaced by SSSD.
# Reason:             Leaving this module in PAM configuration may lock out the system.
# Type:               bool
# Default:            None
# Available choices: True/False
# Unanswered question. Uncomment the following line with your answer
# confirm = 

# 由于pam_pkcs11这个模块阻碍了系统升级,于是我们需要输入以下命令禁用这个模块
[root@localhost ~]# leapp answer --section remove_pam_pkcs11_module_check.confirm=True

升级系统

[root@localhost ~]# leapp upgrade

看到下面提示信息就可以重启等待更新完成了
============================================================
                           REPORT                           
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT                        
============================================================

Answerfile has been generated at /var/log/leapp/answerfile

[root@localhost ~]# reboot

验证版本

[root@localhost ~]# neofetch
        #####           root@localhost.localdomain 
       #######          -------------------------- 
       ##O#O##          OS: Rocky Linux 8.10 (Green Obsidian) x86_64 
       #######          Host: VMware Virtual Platform None 
     ###########        Kernel: 4.18.0-553.8.1.el8_10.x86_64 
    #############       Uptime: 3 mins 
   ###############      Packages: 482 (rpm) 
   ################     Shell: bash 4.4.20 
  #################     Terminal: /dev/pts/0 
#####################   CPU: AMD Ryzen 7 5800X 8- (4) @ 3.792GHz 
#####################   GPU: 00:0f.0 VMware SVGA II Adapter 
  #################     Memory: 271MiB / 7665MiB 

                                                
                                              
[root@localhost ~]# cat /etc/centos-release
Rocky Linux release 8.10 (Green Obsidian)

 

正文完
 0
nekoda
版权声明:本站原创文章,由 nekoda 于2024-07-26发表,共计3139字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)