我决定将远程“实时”服务器从 CentOS 7 升级到 8。我按照这里的说明进行操作https://www.tecmint.com/upgrade-centos-7-to-centos-8/并陷入了无限的失败循环。
# dnf upgrade [or --refresh]
Error: Transaction check error:
file /usr/lib/python2.7/site-packages/six.py from install of python2-six-1.11.0-5.module_el8.2.0+381+9a5b3c3b.noarch conflicts with file from package python-six-1.9.0-2.el7.noarch
file /usr/lib/python2.7/site-packages/six.pyc from install of python2-six-1.11.0-5.module_el8.2.0+381+9a5b3c3b.noarch conflicts with file from package python-six-1.9.0-2.el7.noarch
file /usr/lib/python2.7/site-packages/six.pyo from install of python2-six-1.11.0-5.module_el8.2.0+381+9a5b3c3b.noarch conflicts with file from package python-six-1.9.0-2.el7.noarch
# dnf update --best --allowerasing
CentOS-8 - Base
CentOS-8 - Updates
CentOS-8 - Extras
CentOS-8 - Plus
Failed to synchronize cache for repo 'base', ignoring this repo.
Failed to synchronize cache for repo 'updates', ignoring this repo.
Failed to synchronize cache for repo 'extras', ignoring this repo.
Failed to synchronize cache for repo 'centosplus', ignoring this repo.
Last metadata expiration check: 0:00:38 ago on Sun 18 Oct 2020 07:20:52 AM UTC.
Error:
Problem: The operation would result in removing the following protected packages: dnf
其他尝试都会导致有关重复存储库或使用镜像列表而不是 baseurl 的模糊消息。我在网上找到的解决方案都不起作用,这是我第一次使用 dnf(在那次尝试之前使用的是 yum)。
答案1
您的问题与下载包的不需要的存储库有关,请找到它并禁用它
禁用不需要的 Repo,无法下载(如示例):
删除 repo 包或从 repo 文件夹移动到临时文件夹(作为备份)或使用 subscription-manager 命令:
# subscription-manager repos --disable [repo-package]-x86_64-rpms
# subscription-manager repos --enable [repo-package]-x86_64-rpms
运行命令清理缓存并再次下载元文件
sudo dnf clean all
sudo rm -r /var/cache/dnf
sudo dnf upgrade