欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

yum update异常

程序员文章站 2022-05-29 10:21:22
...

[[email protected] yum.repos.d]# yum install docker-ce-18.06.3.ce-3.el7  docker-ce-cli containerd.io
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * CentOS-Base: mirrors.tuna.tsinghua.edu.cn
软件包 1:docker-ce-cli-20.10.7-3.el7.x86_64 已安装并且是最新版本
正在解决依赖关系
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.4.6-3.1.el7 将被 安装
---> 软件包 docker-ce.x86_64.0.18.06.3.ce-3.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                        架构                    版本                                 源                                 大小
=====================================================================================================================================
正在安装:
 containerd.io                  x86_64                  1.4.6-3.1.el7                        docker-ce-stable                   34 M
 docker-ce                      x86_64                  18.06.3.ce-3.el7                     docker-ce-stable                   41 M

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

总计:74 M
安装大小:297 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test


Transaction check error:
  file /usr/bin/docker from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/bash-completion/completions/docker from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/fish/vendor_completions.d/docker.fish from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-attach.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-build.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-secret-rm.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-secret.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-create.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-inspect.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-logs.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-ls.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-ps.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-rm.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-rollback.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-scale.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service-update.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man1/docker-service.1.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
 file /usr/share/man/man5/Dockerfile.5.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man5/docker-config-json.5.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/man/man8/dockerd.8.gz from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64
  file /usr/share/zsh/vendor-completions/_docker from install of docker-ce-18.06.3.ce-3.el7.x86_64 conflicts with file from package docker-ce-cli-1:20.10.7-3.el7.x86_64

错误概要
-------------

因之前操作yum update异常导致安装软件包时报错。

我的解决方案:
删除/etc/yum.repos.d/下所有.repo文件,从其他机器上拷贝一份,
yum clean all #删除所有yum包索引缓存和下载包的缓存
yum makecache fast #重新建立yum包索引缓存。