ansible离线安装(简易)

# 找一台主机:与准备安装ansible主机相同的主机:即,系统相同即可,比如虚拟机中搭建一套相同的linux环境
# 在这台主机上安装下载工具"yum-utils"
yum install yum-utils

# 创建文件夹,用于存放下载的安装包
mkdir /root/mypackages

# 下载fedora epel源
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

# 下载ansible和所有依赖包:
yumdownloader --resolve --destdir /root/mypackages/ ansible

[root@localhost ~]# 
[root@localhost ~]# rpm -aq yum-utils
yum-utils-1.1.31-42.el7.noarch
[root@localhost ~]# yum install yum-utils
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.bfsu.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-42.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================
 Package                                           Arch                                           Version                                                  Repository                                       Size
=================================================================================================================================================================================================================
Updating:
 yum-utils                                         noarch                                         1.1.31-54.el7_8                                          updates                                         122 k

Transaction Summary
=================================================================================================================================================================================================================
Upgrade  1 Package

Total size: 122 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : yum-utils-1.1.31-54.el7_8.noarch                                                                                                                                                              1/2 
  Cleanup    : yum-utils-1.1.31-42.el7.noarch                                                                                                                                                                2/2 
  Verifying  : yum-utils-1.1.31-54.el7_8.noarch                                                                                                                                                              1/2 
  Verifying  : yum-utils-1.1.31-42.el7.noarch                                                                                                                                                                2/2 

Updated:
  yum-utils.noarch 0:1.1.31-54.el7_8                                                                                                                                                                             

Complete!
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# mkidr /root/mypackages
bash: mkidr: command not found...
Similar command is: 'mkdir'
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# mkdir /root/mypackages
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm^C
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Loaded plugins: fastestmirror, langpacks
epel-release-latest-7.noarch.rpm                                                                                                                                                          |  15 kB  00:00:00     
Examining /var/tmp/yum-root-0IDwvW/epel-release-latest-7.noarch.rpm: epel-release-7-12.noarch
Marking /var/tmp/yum-root-0IDwvW/epel-release-latest-7.noarch.rpm as an update to epel-release-7-11.noarch
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be updated
---> Package epel-release.noarch 0:7-12 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================
 Package                                          Arch                                       Version                                     Repository                                                         Size
=================================================================================================================================================================================================================
Updating:
 epel-release                                     noarch                                     7-12                                        /epel-release-latest-7.noarch                                      24 k

Transaction Summary
=================================================================================================================================================================================================================
Upgrade  1 Package

Total size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : epel-release-7-12.noarch                                                                                                                                                                      1/2 
  Cleanup    : epel-release-7-11.noarch                                                                                                                                                                      2/2 
  Verifying  : epel-release-7-12.noarch                                                                                                                                                                      1/2 
  Verifying  : epel-release-7-11.noarch                                                                                                                                                                      2/2 

Updated:
  epel-release.noarch 0:7-12                                                                                                                                                                                     

Complete!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值