2022-04-20 Centos 8升级至Centos 8 Stream

这篇博客记录了在升级CentOS 8系统到Stream版以及安装Docker过程中遇到的依赖冲突问题。博主详细列出了升级过程中出现的错误,包括docker-ce、cockpit-bridge、authselect、python3-gobject-base和authselect-libs等包的冲突。为了解决这些问题,博主建议了卸载podman后再安装Docker,并给出了相关命令。此外,还分享了如何从CentOS 8.3升级到CentOS Stream的步骤,包括启用特定的yum源、运行dnf命令进行系统同步和重启。
Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

1.查看系统版本

我的系统是CentOS Linux release 8.2.2004 (Core)

# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)

2.Centos 8.3以下须先升级到8.5 ,再升级到 Stream(使用清华源国内相对比较快)

sed -i 's|^#baseurl=http://vault.epel.cloud/$contentdir|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' /etc/yum.repos.d/CentOS-*.repo

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
 

源链接参考

Index of /centos/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

Index of /centos-store/ (epel.cloud)

​​​​​​centos | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

记录:升级的时候出现了一下报错

错误:
 问题 1: package docker-ce-3:20.10.14-3.el7.x86_64 requires containerd.io >= 1.4.1, but none of the providers can be installed
  - cannot install the best update candidate for package docker-ce-3:19.03.12-3.el7.x86_64
  - package containerd.io-1.4.10-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.11-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.12-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.13-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.3-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.3-3.2.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.4-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.6-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.8-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.4.9-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.5.10-3.1.el7.x86_64 is filtered out by modular filtering
  - package containerd.io-1.5.11-3.1.el7.x86_64 is filtered out by modular filtering
 问题 2: package cockpit-bridge-251.1-1.el8.x86_64 conflicts with cockpit-storaged < 233 provided by cockpit-storaged-211.3-1.el8.noarch
  - cannot install the best update candidate for package cockpit-bridge-211.3-1.el8.x86_64
  - problem with installed package cockpit-storaged-211.3-1.el8.noarch
 问题 3: cannot install both authselect-1.2.2-3.el8.x86_64 and authselect-1.1-2.el8.x86_64
  - package authselect-compat-1.1-2.el8.x86_64 requires authselect(x86-64) = 1.1-2.el8, but none of the providers can be installed
  - cannot install the best update candidate for package authselect-1.1-2.el8.x86_64
  - problem with installed package authselect-compat-1.1-2.el8.x86_64
 问题 4: cannot install both python3-gobject-base-3.28.3-2.el8.x86_64 and python3-gobject-base-3.28.3-1.el8.x86_64
  - package python3-gobject-3.28.3-1.el8.x86_64 requires python3-gobject-base(x86-64) = 3.28.3-1.el8, but none of the providers can be installed
  - cannot install the best update candidate for package python3-gobject-base-3.28.3-1.el8.x86_64
  - problem with installed package python3-gobject-3.28.3-1.el8.x86_64
 问题 5: package authselect-1.1-2.el8.x86_64 requires libauthselect.so.1()(64bit), but none of the providers can be installed
  - package authselect-1.1-2.el8.x86_64 requires libauthselect.so.1(AUTHSELECT_1.0.1)(64bit), but none of the providers can be installed
  - package authselect-1.1-2.el8.x86_64 requires libauthselect.so.1(AUTHSELECT_1.0.2)(64bit), but none of the providers can be installed
  - package authselect-1.1-2.el8.x86_64 requires libauthselect.so.1(AUTHSELECT_1.0.3)(64bit), but none of the providers can be installed
  - package authselect-1.1-2.el8.x86_64 requires libauthselect.so.1(AUTHSELECT_1.1.0)(64bit), but none of the providers can be installed
  - package authselect-1.1-2.el8.x86_64 requires authselect-libs(x86-64) = 1.1-2.el8, but none of the providers can be installed
  - package authselect-compat-1.1-2.el8.x86_64 requires authselect(x86-64) = 1.1-2.el8, but none of the providers can be installed
  - cannot install both authselect-libs-1.2.2-3.el8.x86_64 and authselect-libs-1.1-2.el8.x86_64
  - package fprintd-pam-1.90.0-0.20191121gitf022902.el8.x86_64 requires authconfig, but none of the providers can be installed
  - cannot install the best update candidate for package authselect-libs-1.1-2.el8.x86_64
  - problem with installed package fprintd-pam-1.90.0-0.20191121gitf022902.el8.x86_64
(尝试在命令行中添加 '--allowerasing' 来替换冲突的软件包 或 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用最佳选择的软件包)

报错解决记录,有写需要安装的包,根据报错信息需要自行下载安装,如果还是无法更新,可根据提醒添加 '--allowerasing' 来替换冲突的软件包 或 '--skip-broken' 来跳过

Index of linux/centos/8/x86_64/stable/Packages/ (docker.com)

在centos8 安装docker的时候最好将自带podman卸载后再安装

卸载podman

yum -y erase podman buildah

卸载完成后无需重启,可直接安装docker

docker 安装参考

CentOS8卸载podman安装docker - 轶哥 (wyr.me)

Centos 8.3+升级到Centos 8 Stream
第1步

dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos


第2步

dnf distro-sync


重启系统

reboot

 到此升级完成

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

在某些开发环境中,尤其是使用 ESP-IDF(Espressif IoT Development Framework)时,可能会遇到 `std::filesystem::__cxx11::filesystem_error` 错误,错误信息类似于: ``` terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error' what(): filesystem error: Cannot convert character sequence: Illegal byte sequence ``` 该问题通常与系统环境变量或终端字符编码设置有关,特别是在调用 `ccache.exe --version` 时出现。具体来说,当程序尝试访问文件系统路径或处理文件名时,如果路径中包含非 UTF-8 编码的字符,就会导致 C++ 标准库抛出 `std::filesystem_error` 异常 [^1]。 ### 可能的原因 1. **系统区域和语言设置**:Windows 系统的区域设置可能不是基于 UTF-8 编码(例如中文简体环境下的 GBK 编码),这会导致某些工具链组件(如 `ccache`)无法正确解析路径。 2. **ESP-IDF 工具链兼容性**:某些版本的 ESP-IDF 或其依赖工具(如 Python 脚本、`ccache`)对字符编码较为敏感,尤其是在 Windows 上运行时。 3. **环境变量中的非法字符路径**:PATH 或其他环境变量中包含非标准字符的路径也可能触发此类错误。 ### 解决方案 #### 方法一:启用 UTF-8 模式(推荐) 在 Windows 上,可以通过启用“Beta: Use Unicode UTF-8 for worldwide language support”选项来强制系统使用 UTF-8 编码: 1. 打开“控制面板” → “区域” → “管理”选项卡。 2. 点击“更改系统区域设置”。 3. 勾选“Beta: 使用 Unicode UTF-8 提供全球语言支持”。 4. 重启计算机生效设置。 此操作将使整个系统的默认字符集变为 UTF-8,从而避免因字符编码不兼容引发的文件系统异常 [^1]。 #### 方法二:修改 ESP-IDF 构建脚本以绕过 `ccache` 如果暂时不想更改系统设置,可以临时禁用 `ccache` 来规避问题: 1. 打开项目目录下的 `CMakeCache.txt` 文件。 2. 查找并删除所有与 `ccache` 相关的条目。 3. 在构建命令中显式禁用 `ccache`: ```bash export IDF_CCACHE_ENABLE=0 ``` 或者在 Windows 的 CMD 中执行: ```cmd set IDF_CCACHE_ENABLE=0 ``` 这样可以跳过对 `ccache` 的调用,从而避免文件系统异常的发生 [^1]。 #### 方法三:更新 ESP-IDF 和工具链版本 确保使用的 ESP-IDF 版本为官方最新稳定版,并通过 `idf.py install` 更新相关工具链。新版本可能已修复了与字符编码相关的兼容性问题。 --- ### 示例代码片段(用于测试字符编码) 以下是一个简单的 C++ 程序,用于检测当前环境是否能够正确处理 UTF-8 编码的路径: ```cpp #include <iostream> #include <filesystem> namespace fs = std::filesystem; int main() { try { fs::path test_path = u8"测试文件夹"; fs::create_directory(test_path); std::cout << "成功创建目录: " << test_path << std::endl; fs::remove(test_path); } catch (const fs::filesystem_error& e) { std::cerr << "文件系统错误: " << e.what() << std::endl; } return 0; } ``` 编译并运行该程序可验证当前环境是否支持 UTF-8 编码路径。 --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值