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

yum安装ansible报错如何解决

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

yum安装ansible报错如何解决

文章参考:https://mirrors.tuna.tsinghua.edu.cn/help/epel/

网上找的都是重装虚拟机,主要是找回原先镜像源 CentOS-.repo配置文件
由于本人安装后做有备份,把备份拉回来
首先从CentOS Extras这个源(本镜像站也有镜像)里安装epel-release
[root@Centos7 yum.repos.d]#yum install epel-release
原先镜像源
[root@Centos7 yum.repos.d]#ls CentOS
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@Centos7 yum.repos.d]#cat base.repo
[base]
name=base
baseurl=file:///mnt
gpgcheck=0
[enel]
name=aliyun
baseurl=https://mirrors.aliyun.com/epel/ r e l e a s e v e r / releasever/ releasever/basearch/
gpgcheck=0
enabled=1
修改配置文件
[root@Centos7 yum.repos.d]#sed -e ‘s!^metalink=!#metalink=!g’

-e 's!^#baseurl=!baseurl=!g' 
-e 's!//download.fedoraproject.org/pub!//mirrors.tuna.tsinghua.edu.cn!g' 
-e 's!//download.example/pub!//mirrors.tuna.tsinghua.edu.cn!g' 
-e 's!http://mirrors!https://mirrors!g' 
-i CentOS-*

清除缓存,安装
[root@Centos7 yum.repos.d]#yum clean all
[root@Centos7 yum.repos.d]#yum install ansible -y
测试
[root@Centos7 yum.repos.d]#ansible --version
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

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

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

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