标签搜索

Redhat 8版本安装ansible步骤

mrui
2024-03-10 / 0 评论 / 75 阅读 / 正在检测是否收录...

配置本地和网络yum源

rm -rf /etc/yum.repos.d/*
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
vi /etc/yum.repos.d/local.repo
local-BaseOS]
name=local-BaseOS
baseurl=file:///mnt/BaseOS/
enabled=1
gpgcheck=0
[local-APPStream]
name=local-APPStream
baseurl=file:///mnt/AppStream/
enabled=1
gpgcheck=0

直接使用yum安装ansible时会报错

问题: conflicting requests
  - nothing provides /usr/bin/python3.11 needed by ansible-8.3.0-1.el8.noarch
  - nothing provides python(abi) = 3.11 needed by ansible-8.3.0-1.el8.noarch
  - nothing provides python3.11dist(ansible-core) >= 2.15.3 needed by ansible-8.3.0-1.el8.noarch
(尝试添加 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用最佳选择的软件包)

正确的安装方式

yum install python3 python3-pip
pip3 install --upgrade pip
pip3 install setuptools-rust
pip3 install ansible
0

评论

博主关闭了当前页面的评论