ubuntu20.04 安装 ansible-官方 PPA 方式(推荐)

安装

适用:Ubuntu 20.04 / 22.04 / 24.04

# 1. 更新源
sudo apt update

# 2. 安装软件包依赖(提供add-apt-repository命令)
sudo apt install software-properties-common -y

# 3. 添加Ansible官方PPA源,并自动更新源
sudo add-apt-repository --yes --update ppa:ansible/ansible

# 4. 安装ansible
sudo apt install ansible -y

查看版本

ansible --version

PixPin_20260910_112357.png