首页 > 系统相关 >如何将CentOS Stream退回为CentOS 8.5

如何将CentOS Stream退回为CentOS 8.5

时间:2023-03-27 10:32:45浏览次数:39  
标签:8.5 Stream centos CentOS repo release rm


CentOS 8 已于 2021 年年底正式停止维护,因业务需要,老大说,换Steam吧,后面环境有问题果然反悔了,哈哈,怎么办,没降级工具哦,那就喊我吃后悔药了。

说明:原来版本是 8.5.2111,换Steam以后没有升过级,如果你的已经做了 DNF Update,那还是重装吧。

思路就是:

1、卸载centos-stream

2、清理所有的yum.repos.d/文件(残留软件源会出错)

3、恢复CentOS Vault 源,否则你会收到Cannot prepare internal mirrorlist: No URLs in mirrorlist

直接DNF不行
[root@localhost tmp]# dnf remove -y centos-stream-release-8.5-2.el8.noarch
Repository extras is listed more than once in the configuration
错误:
 问题: 这个操作将会导致删除以下受保护的软件包: setup
(尝试添加 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用软件包的最佳候选)

[root@localhost tmp]# rpm -e  centos-stream-release-8.5-2.el8.noarch

卸载完成以后会发现没有版本号了,需要恢复

[root@localhost tmp]# cat /etc/centos-release
cat: /etc/centos-release: 没有那个文件或目录

清理所有的yum.repos.d/文件

[root@localhost tmp]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm  *.*

rm:是否删除普通文件 'CentOS-Base.repo'?y
rm:是否删除普通文件 'CentOS-Linux-AppStream.repo'?y
rm:是否删除普通文件 'CentOS-Linux-BaseOS.repo'?y
rm:是否删除普通文件 'CentOS-Linux-ContinuousRelease.repo'?y
rm:是否删除普通文件 'CentOS-Linux-Debuginfo.repo'?y
rm:是否删除普通文件 'CentOS-Linux-Devel.repo'?y
rm:是否删除普通文件 'CentOS-Linux-Extras.repo'?y
rm:是否删除普通文件 'CentOS-Linux-FastTrack.repo'?y
rm:是否删除普通文件 'CentOS-Linux-HighAvailability.repo'?y
rm:是否删除普通文件 'CentOS-Linux-Media.repo'?y
rm:是否删除普通文件 'CentOS-Linux-Plus.repo'?y
rm:是否删除普通文件 'CentOS-Linux-PowerTools.repo'?y
rm:是否删除普通文件 'CentOS-Linux-Sources.repo'?y

恢复CentOS Vault 源

[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo?spm=a2c6h.25603864.0.0.3d975969bkIquB
--2022-07-14 04:37:38--  http://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo?spm=a2c6h.25603864.0.0.3d975969bkIquB
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 116.55.237.227, 116.55.237.231, 116.55.237.228, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|116.55.237.227|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2495 (2.4K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

/etc/yum.repos.d/Ce 100%[===================>]   2.44K  --.-KB/s  用时 0.002s

2022-07-14 04:37:38 (1.46 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2495/2495])

[root@localhost yum.repos.d]# dnf makecache
无法找到发布版本(可用 '--releasever' 指定版本)
CentOS-8.5.2111 - Base - mirrors.aliyun.com      12 kB/s | 3.9 kB     00:00
CentOS-8.5.2111 - Extras - mirrors.aliyun.com   4.8 kB/s | 1.5 kB     00:00
CentOS-8.5.2111 - AppStream - mirrors.aliyun.co  11 kB/s | 4.3 kB     00:00
元数据缓存已建立。

恢复8.5-1.2111
[root@localhost yum.repos.d]# dnf install  centos-linux-release.noarch 8.5-1.2111.el8
无法找到发布版本(可用 '--releasever' 指定版本)
上次元数据过期检查:0:00:08 前,执行于 2022年07月14日 星期四 04时37分46秒。
未找到匹配的参数: 8.5-1.2111.el8
错误:没有任何匹配: 8.5-1.2111.el8

[root@localhost yum.repos.d]# dnf install  centos-linux-release.noarch
无法找到发布版本(可用 '--releasever' 指定版本)
上次元数据过期检查:0:00:16 前,执行于 2022年07月14日 星期四 04时37分46秒。
依赖关系解决。
================================================================================
 软件包                     架构         版本                  仓库        大小
================================================================================
安装:
 centos-linux-release       noarch       8.5-1.2111.el8        base        22 k

事务概要
================================================================================
安装  1 软件包

总下载:22 k
安装大小:26 k
确定吗?[y/N]: y
下载软件包:
centos-linux-release-8.5-1.2111.el8.noarch.rpm   67 kB/s |  22 kB     00:00
--------------------------------------------------------------------------------
总计                                             66 kB/s |  22 kB     00:00
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                 1/1
  安装    : centos-linux-release-8.5-1.2111.el8.noarch                      1/1
  运行脚本: centos-linux-release-8.5-1.2111.el8.noarch                      1/1
  验证    : centos-linux-release-8.5-1.2111.el8.noarch                      1/1

已安装:
  centos-linux-release-8.5-1.2111.el8.noarch

然后 cat: /etc/centos-release 试下。

标签:8.5,Stream,centos,CentOS,repo,release,rm
From: https://blog.51cto.com/u_696257/6151319

相关文章

  • C++ stringstream ssin 的用法
    C++中stringstream方法存在于头文件<sstream>中作用:使用stringstream方法,将某一字符串生成输入流,然后可以利用这个输入流把长的整行字符串转换成单个字符#include......
  • Centos7 安装 mysql 8
    安装1.配置yum仓库#更新密钥rpm-importhttps:/repo.mysql.com/RPM-GPG-KEYmysql-202#安装Mysql8.x版本yum库rpm-Uvhhttps:/dev.mysql.com/get/mysql80-commu......
  • Centos7安装Python3.7
    说明:全部操作都在root用户下执行,python3.7安装在/root/python3目录下1.安装编译相关工具yum-ygroupinstall"Developmenttools"yum-yinstallzlib-develbzip2-dev......
  • centos7 yum -y install nodejs安装npm时报错,处理方法
     centos7yum-yinstallnodejs安装npm时报错,处理方法安装npm时报错,处理方法sudo:npm:commandnotfoundsudoyum-yinstallnodejsLoadedplugins:fastestmirr......
  • centos7升级openssh9.3p1
    centos7升级openssh9.3p1制作rpm包安装依赖包yuminstall-yrpm-buildgccgcc-c++glibcglibc-developenssl-developensslpcre-develzlibzlib-develmakewget......
  • Centos8安装JDK
    官网下载页:https://www.oracle.com/java/technologies/downloads/选择自己需要的JDK版本进行下载即可一、下载上传https://docs.oracle.com/javase/8/docs/technotes/guide......
  • centos7设置jar包开机自启动
    在linux运行jar包的命令是java -jar xxx.jar如果想要在后台运行的话就加&,终端退出后命令仍旧执行java-jarxxx.jar&这样退出当前远程登录界面这个jar包也......
  • Centos8安装MySQL
    受苦于博客总是过于老旧,安装时总会出现版本包已经删除的情况而且步骤总是各式各样难以理解,无奈之下还是官网靠谱,于是这篇博客以官网方法为基准,方便以后安装的时候可以直接......
  • centos7安装Docker(转)
    原文:https://cloud.tencent.com/developer/article/17014511、安装前必读在安装Docker之前,先说一下配置,我这里是Centos7Linux内核:官方建议3.10以上,3.8以上貌似也可......
  • 【JAVA】InputStreamReader的正确使用方法
    InputStreamReader是JavaI/O中的一个类,用于将字节流转换为字符流。下面是InputStreamReader的正确使用方法:创建InputStreamReader对象。可以传入一个InputStream对象和一个......