yum install ansible无法直接安装Ansible的解决方法
2017-11-22 10:23
369 查看
1、系统版本:
[root@www yum.repos.d]# uname -a
Linux www.zero04.com 2.6.39-400.17.1.el6uek.x86_64 #1 SMP Fri Feb 22 18:16:18 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
2、直接yum install ansible后无效
[root@www /]# yum install ansible
Loaded plugins: security
Setting up Install Process
No package ansible available.
Error: Nothing to do
原因:Base yum源中没有ansible的安装包
3、更换为epel.repo yum 源
> 先将原有Base源备份
[root@www yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
> 更换yum源
wget -O epel.repohttp://mirrors.aliyun.com/repo/epel-6.repo
> yum clean all
Loaded plugins: security
Cleaning repos: epel
Cleaning up Everything
> yum makecache
Loaded plugins: security
epel | 4.7 kB 00:00
epel/group_gz | 255 kB 00:00
epel/filelists_db | 7.8 MB 00:14
epel/updateinfo | 758 kB 00:01
epel/prestodelta | 360 B 00:00
epel/primary_db | 6.0 MB 00:10
epel/other_db | 3.0 MB 00:05
Metadata Cache Created
4、yum -y install ansible后仍然报错
--> Finished Dependency Resolution
Error: Package: python-jinja2-26-2.6-3.el6.noarch (epel)
Requires: python-babel >= 0.8
Error: Package: python-keyczar-0.71c-1.el6.noarch (epel)
Requires: python-pyasn1
Error: Package: python-jinja2-26-2.6-3.el6.noarch (epel)
Requires: python-markupsafe
Error: Package: ansible-2.3.2.0-1.el6.noarch (epel)
Requires: python-simplejson
Error: Package: ansible-2.3.2.0-1.el6.noarch (epel)
Requires: PyYAML
Error: Package: ansible-2.3.2.0-1.el6.noarch (epel)
Requires: python-six
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
原因:环境中没有python-simplejson python-babel PyYAML python-six python-pyasn1 python-markupsafe 这些包
解决方法:更换Base.repo yum源,执行
yum install python-simplejson python-babel PyYAML python-six python-pyasn1 python-markupsafe
注意:更换yum源要分别执行
a>yum clean all
b> yum makecache
5、[root@www yum.repos.d]# yum install python-simplejson python-babel PyYAML python-six python-pyasn1 python-markupsafe
Complete!
6、切换为epel yum源,再执行 yum -y install ansible
[root@www yum.repos.d]# yum -y install ansible
Complete!
7、查看ansible版本
[root@www yum.repos.d]# ansible --version
ansible 2.5.0
至此,Ansible 安装成功!
备注:如果在执行ansible --version过程中出现如下错误,直接yum intall python-jinja2 即可
Traceback (most recent call last):
File "/usr/bin/ansible", line 43, in <module>
import ansible.constants as C
File "/usr/lib/python2.6/site-packages/ansible-2.5.0-py2.6.egg/ansible/constants.py", line 11, in <module>
from jinja2 import Template
<
4000
div style="line-height:1.75;">ImportError: No module named jinja2
[root@www yum.repos.d]# uname -a
Linux www.zero04.com 2.6.39-400.17.1.el6uek.x86_64 #1 SMP Fri Feb 22 18:16:18 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
2、直接yum install ansible后无效
[root@www /]# yum install ansible
Loaded plugins: security
Setting up Install Process
No package ansible available.
Error: Nothing to do
原因:Base yum源中没有ansible的安装包
3、更换为epel.repo yum 源
> 先将原有Base源备份
[root@www yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
> 更换yum源
wget -O epel.repohttp://mirrors.aliyun.com/repo/epel-6.repo
> yum clean all
Loaded plugins: security
Cleaning repos: epel
Cleaning up Everything
> yum makecache
Loaded plugins: security
epel | 4.7 kB 00:00
epel/group_gz | 255 kB 00:00
epel/filelists_db | 7.8 MB 00:14
epel/updateinfo | 758 kB 00:01
epel/prestodelta | 360 B 00:00
epel/primary_db | 6.0 MB 00:10
epel/other_db | 3.0 MB 00:05
Metadata Cache Created
4、yum -y install ansible后仍然报错
--> Finished Dependency Resolution
Error: Package: python-jinja2-26-2.6-3.el6.noarch (epel)
Requires: python-babel >= 0.8
Error: Package: python-keyczar-0.71c-1.el6.noarch (epel)
Requires: python-pyasn1
Error: Package: python-jinja2-26-2.6-3.el6.noarch (epel)
Requires: python-markupsafe
Error: Package: ansible-2.3.2.0-1.el6.noarch (epel)
Requires: python-simplejson
Error: Package: ansible-2.3.2.0-1.el6.noarch (epel)
Requires: PyYAML
Error: Package: ansible-2.3.2.0-1.el6.noarch (epel)
Requires: python-six
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
原因:环境中没有python-simplejson python-babel PyYAML python-six python-pyasn1 python-markupsafe 这些包
解决方法:更换Base.repo yum源,执行
yum install python-simplejson python-babel PyYAML python-six python-pyasn1 python-markupsafe
注意:更换yum源要分别执行
a>yum clean all
b> yum makecache
5、[root@www yum.repos.d]# yum install python-simplejson python-babel PyYAML python-six python-pyasn1 python-markupsafe
Complete!
6、切换为epel yum源,再执行 yum -y install ansible
[root@www yum.repos.d]# yum -y install ansible
Complete!
7、查看ansible版本
[root@www yum.repos.d]# ansible --version
ansible 2.5.0
至此,Ansible 安装成功!
备注:如果在执行ansible --version过程中出现如下错误,直接yum intall python-jinja2 即可
Traceback (most recent call last):
File "/usr/bin/ansible", line 43, in <module>
import ansible.constants as C
File "/usr/lib/python2.6/site-packages/ansible-2.5.0-py2.6.egg/ansible/constants.py", line 11, in <module>
from jinja2 import Template
<
4000
div style="line-height:1.75;">ImportError: No module named jinja2
相关文章推荐
- centos 7 yum install mysql 安装mariadb 后 mysql 无法启动的解决方法
- centos 7 yum install mysql 安装mariadb 后 mysql 无法启动的解决方法
- sublime text3刚从官网下载安装后,Ctrl+B无法直接运行Python文件问题--解决方法
- yum安装openJDK1.8后无法卸载的解决方法
- Maven安装成功后,总是无法成功mvn install?解决方法是JDK设置的问题。
- Centos 7 安装 Python3.6后yum无法使用的解决方法
- VS2010关于WindowsService 制作安装程序包,无法自动install的问题解决方法
- Ubuntu通过apt-get install安装mysql后pdo_mysql无法连接的解决方法
- bunt 安装 yum出现 ubuntu 解决“无法获得锁 /var/lib/dpkg/lock -open (11:资源暂时不可用)”的方法
- 安装软件时提示错误1719 无法访问windows install服务的解决方法
- 【转】ubunt 安装 yum出现 ubuntu 解决“无法获得锁 /var/lib/dpkg/lock -open (11:资源暂时不可用)”的方法
- yum安装openJDK1.8后无法卸载的快速解决方法
- an error occurred attempting install_Github_for_windows_无法安装的解决方法_
- 非正常注册的RHEL无法YUM安装软件解决方法
- 安装CentOS7文字界面版后,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
- 安装windows server 2016报错无法打开所需文件install.wim的解决方法
- python2.7无法使用pip的解决方法(安装easy_install)
- 安装CentOS7后,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
- 安装centos mini版,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
- 安装CentOS7文字界面版后,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法