栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

yum安装ansible报错如何解决

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

yum安装ansible报错如何解决

前言:安装ansible出现如下错误:

Error: Package: python-paramiko-2.1.1-0.10.el7.noarch (epel)

Requires: python-cryptography

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python-six

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: PyYAML

Error: Package: python-paramiko-2.1.1-0.10.el7.noarch (epel)

Requires: python2-pyasn1

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python2-cryptography

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python-jinja2

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python-setuptools

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

[](()一、报错信息:


[root@ansible ~]# yum install -y ansible

Loaded plugins: fastestmirror

Repository epel is listed more than once in the configuration

Repository epel-debuginfo is listed more than once in the configuration

Repository epel-source is listed more than once in the configuration

Loading mirror speeds from cached hostfile

  • epel: mirrors.tuna.tsinghua.edu.cn

Resolving Dependencies

–> Running transaction check

—> Package ansible.noarch 0:2.9.21-1.el7 will be installed

–> Processing Dependency: PyYAML for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-httplib2 for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-jinja2 for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-paramiko for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-setuptools for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-six for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python2-cryptography for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python2-jmespath for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: sshpass for package: ansible-2.9.21-1.el7.noarch

–> Running transaction check

—> Package ansible.noarch 0:2.9.21-1.el7 will be installed

–> Processing Dependency: PyYAML for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-jinja2 for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-setuptools for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python-six for package: ansible-2.9.21-1.el7.noarch

–> Processing Dependency: python2-cryptography for package: ansible-2.9.21-1.el7.noarch

—> Package python-paramiko.noarch 0:2.1.1-0.10.el7 will be installed

–> Processing Dependency: python-cryptography for package: python-paramiko-2.1.1-0.10.el7.noarch

–> Processing Dependency: python2-pyasn1 for package: python-paramiko-2.1.1-0.10.el7.noarch

—> Package python2-httplib2.noarch 0:0.18.1-3.el7 will be installed

—> Package python2-jmespath.noarch 0:0.9.4-2.el7 will be installed

—> Package sshpass.x86_64 0:1.06-1.el7 will be installed

–> Finished Dependency Resolution

Error: Package: python-paramiko-2.1.1-0.10.el7.noarch (epel)

Requires: python-cryptography

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python-six

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: PyYAML

Error: Package: python-paramiko-2.1.1-0.10.el7.noarch (epel)

Requires: python2-pyasn1

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python2-cryptography

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python-jinja2

Error: Package: ansible-2.9.21-1.el7.noarch (epel)

Requires: python-setuptools

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

[](()二、如何解决


[](()1、重装虚拟机

重装一台虚拟机,保证虚拟机可以上网,可以选择桥接模式网卡

![在这里插入图片描述](https://img-blog.csdnimg.cn/20210620202446369.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ1NzE0Mjcy,size_16,color_FF 《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》无偿开源 威信搜索公众号【编程进阶路】 FFFF,t_70)

[](()2、修改yum源

建议先备份 /etc/yum.repos.d/ 内的文件(CentOS 7 及之前为 CentOS-Base.repo,CentOS 8 为CentOS-Linux-*.repo)

然后编辑 /etc/yum.repos.d/ 中的相应文件,在 mirrorlist= 开头行前面加 # 注释掉;并将 baseurl= 开头行取消注释(如果被注释的话),把该行内的域名(例如mirror.centos.org)替换为 mirrors.tuna.tsinghua.edu.cn。

以上步骤可以被下方的命令一步完成

sudo sed -e ‘s|^mirrorlist=|#mirrorlist=|g’

-e ‘s|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g’

-i.bak

/etc/yum.repos.d/CentOS-*.repo

注意其中的*通配符,如果只需要替换一些文件中的源,请自行增删。

注意,如果需要启用其中一些 repo,需要将其中的 enabled=0 改为 enabled=1。

最后,更新软件包缓存

sudo yum makecache

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/864398.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号