本地yum 源 iso文件 安装ansible + yum 下载全量依赖 rpm 包及离线安装(终极解决方案)
1.挂载
# mkdir /mnt/cdrom # mount /mnt/CentOS-7.0-1406-x86_64-DVD.iso /mnt/cdrom/
2.配置
# touch CentOS-ISO.repo # cat CentOS-ISO.repo [base] name=CentOS-$releasever – Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra baseurl=file:///mnt/cdrom enabled=1 gpgcheck=0 gpgkey=file:///mnt/cdrom/rpm-gpg/RPM-GPG-KEY-CentOS-7
参考:https://blog.51cto.com/11495268/2314967
3. yum 下载全量依赖 rpm 包及离线安装(终极解决方案)
# 安装插件 $ yum -y install yum-download # 下载 ansible 依赖包 $ yum -y install ansible --downloadonly --downloaddir=/tmp
4. 离线安装 rpm
$ rpm -Uvh --force --nodeps *.rpm
参考:https://blog.csdn.net/jlh21/article/details/104775084/
用一个例子来演示会更加清晰