yum +消息是什么 - 没有包ansible可用

时间:2015-08-17 10:25:04

标签: linux ansible yum

我尝试在我的linux red-hat版本上安装ansible工具 - 5.7

yum install ansible
Loaded plugins: security
Setting up Install Process
No package ansible available.
Nothing to do

ansible未安装在我的linux机器上 - 当然!

所以为什么我得到 - 没有包装ansible可用。以及如何解决这个问题?

来自yum.repos.d的视图是:

/etc/yum.repos.d]# ls
rhel-debuginfo.repo  rhel-source.repo  service-cd-repo.repo  stp-default-   repo.repo

我已解决如下问题:

ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=50 time=63.4 ms

更新 - 尝试安装epel-release软件包

yum install epel-release
Loaded plugins: security
service-cd                                                                                                      |  951 B     00:00     
swp-default                                                                                                  |  951 B     00:00     
Setting up Install Process
No package epel-release available.
Nothing to do

第二次更新:

  wget --no-check-certificate https://dl.fedoraproject.org/pub/epel/epel- release-latest-5.noarch.rpm
 --2015-08-17 14:54:20--  https://dl.fedoraproject.org/pub/epel/epel-   release-latest-5.noarch.rpm
  Resolving dl.fedoraproject.org... 209.132.181.26, 209.132.181.27,   209.132.181.25, ...
  Connecting to dl.fedoraproject.org|209.132.181.26|:443... connected.
 WARNING: cannot verify dl.fedoraproject.org's certificate, issued by     `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Hig:
  Unable to locally verify the issuer's authority.
  HTTP request sent, awaiting response... 200 OK
  Length: 12232 (12K) [application/x-rpm]
  Saving to: `epel-release-latest-5.noarch.rpm'

  100%  [==========================================================================================>] 12,232      54.0K/s   in 0.2s    

     2015-08-17 14:54:22 (54.0 KB/s) - `epel-release-latest-5.noarch.rpm.1' saved [12232/12232]


 rpm -ivh epel-release-latest-5.noarch.rpm
 warning: epel-release-latest-5.noarch.rpm: Header V3 DSA signature:  NOKEY, key ID 217521f6
 Preparing...                ###########################################   [100%]



  yum repolist
  Loaded plugins: security
  epel                                                                                                               | 3.7 kB     00:00     
   service-cd                                                                                                      |  951 B     00:00     
 swp-default                                                                                                   |  951 B     00:00     
repo id                                       repo name                                                                          status
epel                                          Extra Packages for      Enterprise Linux 5 - i386                                    5,411
service-cd                                    RHEL5 service-cd repository                                                         155
 swp-default                                   RHEL5 yum repository                                                                 239
  repolist: 5,805



 yum install ansible
 Loaded plugins: security
 Setting up Install Process
 No package ansible available.
 Nothing to do

2 个答案:

答案 0 :(得分:5)

Ansible是 Enterprise Linux (EPEL)存储库的一部分,因此您需要先install epel-release package

$ sudo yum install epel-release

回购列表

现在应该可以看到回购
$ sudo yum repolist

所以现在你可以继续安装ansible

$ sudo yum install ansible

在RHEL 7.x之前,需要手动完成安装。 打开install epel-release package并下载EL5的最新版 epel-release 或按照以下命令

$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
$ sudo rpm –ivh epel-release-latest-5.noarch.rpm
$ sudo yum repolist
$ sudo yum install ansible

在ansible的安装手册中,这称为configure EPEL

希望这会有所帮助:)

对第二次更新的响应

手动安装时,您可能还需要使缓存过期并重新创建本地存储库数据库,然后才能从EPEL安装软件。这可以通过以下

来完成
$ yum clean expire-cache
$ yum createrepo 

答案 1 :(得分:0)

EPEL是必需的。

按照以下步骤安装适用于Red Hat Enterprise Linux Server 7的Ansible 基于redhat版本,请关注 Enabline EPEL

1. yum -y update
2. yum install wget
3. wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
4. rpm -ivh epel-release-7-6.noarch.rpm
5. yum repolist
6. yum install ansible