Installing Ansible on Offline Kylin Server

Recently, I learned about some minor issues encountered when installing software packages in an internal network environment. I would like to share this with everyone and hope for your suggestions!

1. Install yum-utils

  • Error: not found

# yum install yum-utils -yLast metadata expiration check: 0:00:50 ago on Wednesday, September 17, 2025 09:25:19. No match for argument: yum-utilsError: No match: yum-utils

2. Resolve the absence of yum-utils

  • Use dnf-utils

yum install dnf-utils -yThis includes yum-utilsVerify: yumdownloader --help
  • If multiple help messages appear, it indicates that yum-utils is already present

3. Download Ansible-related dependencies on a machine with internet access of the same version

Check the version of the Linux system

cat /etc/os-releaseThe result is as follows:NAME="Kylin Linux Advanced Server"VERSION="V10 (Lance)"ID="kylin"VERSION_ID="V10"PRETTY_NAME="Kylin Linux Advanced Server V10 (Lance)"ANSI_COLOR="0;31
Create a temporary file (the tmp folder is for storing temporary files)mkdir -p /tmp/ansible-rpm && cd /tmp/ansible-rpmDownload Ansible-related dependencies: yumdownloader --resolve --destdir=. ansible

4. Copy all downloaded dependencies to the internal network machine

  • Compress the related packages:

tar -zcvf xxx.tar.gz directory_to_compress/

5. Installation

  • Navigate to the appropriate directory — extract the compressed package:

tar -zxvf xxx.tar.gzInstall all dependencies: yum localinstall *.rpm -yAfter installation, verify: ansible --version
All of the above was implemented on a testing virtual machine; adjustments may be needed in a production environment!

Leave a Comment