AIX にローカル(インターネット非接続)で dnf を導入する

##### はじめに

AIX に dnf (yumの後継)を dnf_budle.tar を使用してローカル(インターネット非接続環境)で導入します。

----
##### 環境

AIX 7.2 TL5 SP 3

```
# oslevel -s
7200-05-03-2135
```

----
##### 使用モジュール

AIX 7bundle モジュール配置サイトから dnf_bundle_aix_71_72.tar を入手

http://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc

----
##### 導入

1) dnf_bundle_aix_71_72.tar をサーバーに配置

```
# ls -l
total 343544
-rw-r--r--    1 root     system    175892480 Jan 14 18:36 dnf_bundle_aix_71_72.tar
```

2) バンドル・ファイルの展開

```
# tar -xvf dnf_bundle_aix_71_72.tar
<ログ省略>

# ls -l
total 687160
-rw-r-----    1 root     system       952182 Jul 11 2021  ca-certificates-2020.06.01-0.aix7.1.ppc.rpm
-rw-------    1 root     system        11676 Jul 21 20:10 dnf-4.2.17-32_1.aix7.1.noarch.rpm
-rw-------    1 root     system        13016 Jul 21 20:10 dnf-automatic-4.2.17-32_1.aix7.1.noarch.rpm
-rw-------    1 root     system        24151 Jul 21 20:10 dnf-data-4.2.17-32_1.aix7.1.noarch.rpm
-rw-r--r--    1 root     system    175892480 Jan 14 18:36 dnf_bundle_aix_71_72.tar
-rw-r--r--    1 root     system          218 Jul 11 2021  extra_list
-rwx------    1 root     system        11065 Oct 29 23:40 install_dnf.sh
-rw-------    1 root     system      1273338 Jul 11 2021  libcomps-0.1.11-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system     15810379 Jul 12 2021  libdnf-0.39.1-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system      3419904 Jul 11 2021  libmodulemd-1.5.2-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system      3650338 Jul 11 2021  librepo-1.11.0-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system       183412 Jul 11 2021  libsmartcols-2.34-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system      1533403 Jul 11 2021  libsolv-0.7.9-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system       469194 Jul 11 2021  libzstd-1.4.4-32_1.aix7.1.ppc.rpm
-rw-r-----    1 root     system      1047702 Jul 11 2021  p11-kit-0.23.16-0.aix7.1.ppc.rpm
-rw-r-----    1 root     system        39777 Jul 11 2021  p11-kit-tools-0.23.16-0.aix7.1.ppc.rpm
-rw-r-----    1 root     system     43168080 Jul 11 2021  python3-3.7.9-0.aix7.1.ppc.rpm
-rw-r--r--    1 root     system       363137 Jul 11 2021  python3-dateutil-2.8.0-1.aix6.1.noarch.rpm
-rw-r-----    1 root     system       237244 Jul 11 2021  python3-devel-3.7.9-0.aix7.1.ppc.rpm
-rw-------    1 root     system       197935 Jul 21 20:10 python3-dnf-4.2.17-32_1.aix7.1.noarch.rpm
-rw-------    1 root     system         8546 Jul 21 23:08 python3-dnf-plugin-migrate-4.0.16-32_1.aix7.1.noarch.rpm
-rw-------    1 root     system        49763 Jul 21 23:08 python3-dnf-plugins-core-4.0.16-32_1.aix7.1.noarch.rpm
-rw-r-----    1 root     system      2993180 Jul 11 2021  python3-docs-3.7.9-0.aix7.1.ppc.rpm
-rw-------    1 root     system       682308 Jul 11 2021  python3-gpgme-1.13.1-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system      3113691 Jul 12 2021  python3-hawkey-0.39.1-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system      1020925 Jul 11 2021  python3-libcomps-0.1.11-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system     22549730 Jul 12 2021  python3-libdnf-0.39.1-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system      2292962 Jul 11 2021  python3-librepo-1.11.0-32_1.aix7.1.ppc.rpm
-rw-r--r--    1 root     system       514483 Jul 11 2021  python3-six-1.13.0-1.aix6.1.noarch.rpm
-rw-r-----    1 root     system     28383122 Jul 11 2021  python3-test-3.7.9-0.aix7.1.ppc.rpm
-rw-r-----    1 root     system        12734 Jul 11 2021  python3-tools-3.7.9-0.aix7.1.ppc.rpm
-rw-------    1 root     system       100168 Jul 11 2021  rpm-python3-4.15.1-32_1.aix7.1.ppc.rpm
-rw-r--r--    1 root     system     40620032 Jul 11 2021  rpm.rte
-rw-------    1 root     system         9188 Jul 21 20:10 yum-4.2.17-32_1.aix7.1.noarch.rpm
-rw-------    1 root     system       552363 Jul 11 2021  zchunk-1.1.4-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system        19487 Jul 11 2021  zchunk-devel-1.1.4-32_1.aix7.1.ppc.rpm
-rw-------    1 root     system       534328 Jul 11 2021  zchunk-libs-1.1.4-32_1.aix7.1.ppc.rpm


```

3) install_dnf.sh の確認


```
# ls -l install_dnf.sh
-rwx------    1 root     system        11065 Oct 29 23:40 install_dnf.sh
```

ヘルプの確認

```
./install_dnf.sh --help
Usage: install_dnf.sh <-d> <-y> <-n> -?

          -d    Install and setup dnf if yum is not installed.
          -y    Update yum3 to yum4(softlink to DNF).
            Use this option if want to redirect all yum commands to dnf.
            Existing yum-3.4.3 will be updated to yum-4.x.x(dnf)
          -n    Install dnf where both yum and dnf can coexist if yum is installed already.
                This is not a recommended option.
```

4) install_dnf.sh の実行

```
# time ./install_dnf.sh -d

Installing rpm.rte at the latest version ...
This may take several minutes depending on the number of rpms installed...
+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

WARNINGS
--------
  Problems described in this section are not likely to be the source of any
  immediate or serious failures, but further actions may be necessary or
  desired.

  Already Installed
  -----------------
  The number of selected filesets that are either already installed
  or effectively installed through superseding filesets is 1.  See
  the summaries at the end of this installation for details.

  NOTE:  Base level filesets may be reinstalled using the "Force"
  option (-F flag), or they may be removed, using the deinstall or
  "Remove Software Products" facility (-u flag), and then reinstalled.

  << End of Warning Section >>

+-----------------------------------------------------------------------------+
                   BUILDDATE Verification ...
+-----------------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS
------------------
    1  Selected to be installed, of which:
        1  Already installed (directly or via superseding filesets)
  ----
    0  Total to be installed


Pre-installation Failure/Warning Summary
----------------------------------------
Name                      Level           Pre-installation Failure/Warning
-------------------------------------------------------------------------------
rpm.rte                   4.15.1.3        Already installed



Checking whether any of the rpms from dnf_bundle are already installed...
Takes couple of minutes to process.

ca-certificates-2020.06.01-0 will be installed
dnf-4.2.17-32_1 will be installed
dnf-automatic-4.2.17-32_1 will be installed
dnf-data-4.2.17-32_1 will be installed
libcomps-0.1.11-32_1 will be installed
libdnf-0.39.1-32_1 will be installed
libmodulemd-1.5.2-32_1 will be installed
librepo-1.11.0-32_1 will be installed
libsmartcols-2.34-32_1 will be installed
libsolv-0.7.9-32_1 will be installed
libzstd-1.4.4-32_1 will be installed
p11-kit-0.23.16-0 will be installed
p11-kit-tools-0.23.16-0 will be installed
python3-3.7.9-0 will be installed
python3-dnf-4.2.17-32_1 will be installed
python3-gpgme-1.13.1-32_1 will be installed
python3-hawkey-0.39.1-32_1 will be installed
python3-libcomps-0.1.11-32_1 will be installed
python3-libdnf-0.39.1-32_1 will be installed
python3-librepo-1.11.0-32_1 will be installed
rpm-python3-4.15.1-32_1 will be installed
zchunk-libs-1.1.4-32_1 will be installed

Installing the packages...

Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-3.7.9-0                  ################################# [  5%]
   2:libzstd-1.4.4-32_1               ################################# [  9%]
   3:libmodulemd-1.5.2-32_1           ################################# [ 14%]
   4:libsolv-0.7.9-32_1               ################################# [ 18%]
   5:libsmartcols-2.34-32_1           ################################# [ 23%]
   6:zchunk-libs-1.1.4-32_1           ################################# [ 27%]
   7:librepo-1.11.0-32_1              ################################# [ 32%]
   8:rpm-python3-4.15.1-32_1          ################################# [ 36%]
   9:libdnf-0.39.1-32_1               ################################# [ 41%]
  10:python3-libdnf-0.39.1-32_1       ################################# [ 45%]
  11:python3-hawkey-0.39.1-32_1       ################################# [ 50%]
  12:libcomps-0.1.11-32_1             ################################# [ 55%]
  13:python3-libcomps-0.1.11-32_1     ################################# [ 59%]
  14:python3-gpgme-1.13.1-32_1        ################################# [ 64%]
  15:p11-kit-0.23.16-0                ################################# [ 68%]
  16:p11-kit-tools-0.23.16-0          ################################# [ 73%]
  17:dnf-data-4.2.17-32_1             ################################# [ 77%]
  18:python3-dnf-4.2.17-32_1          ################################# [ 82%]
  19:dnf-4.2.17-32_1                  ################################# [ 86%]
  20:dnf-automatic-4.2.17-32_1        ################################# [ 91%]
  21:ca-certificates-2020.06.01-0     ################################# [ 95%]
  22:python3-librepo-1.11.0-32_1      ################################# [100%]

dnf installed successfully.
Please run 'dnf update' to update packages to the latest level.

Please note, RPM packages are downloaded in dnf cache /var/cache/dnf.
RPM packages install files go under the path /opt.
Hence it is recommended to always keep at least 512MB of free space in /var & /opt
to avoid any download and installation/update failures.


real    0m34.24s
user    0m6.56s
sys     0m3.23s
# echo $?
0
```

=> インストール所要は 35秒程度でした。



5) コマンド、ディレクトリ確認

```
# which dnf
/opt/freeware/bin/dnf
#
# ls -l /opt/freeware/etc/dnf
total 8
drwxr-xr-x    2 root     system          256 Jul 21 17:42 aliases.d
-rw-r--r--    1 root     system          696 Jan 17 11:13 dnf.conf
drwxr-xr-x    2 root     system          256 Jan 17 11:13 logrotate.d
drwxr-xr-x    2 root     system          256 Jul 21 17:42 modules.d
drwxr-xr-x    2 root     system          256 Jul 21 17:42 modules.defaults.d
drwxr-xr-x    2 root     system          256 Jul 21 17:42 plugins
drwxr-xr-x    2 root     system          256 Jan 17 11:13 protected.d
drwxr-xr-x    2 root     system          256 Jan 17 11:13 vars
```



----

dnf が導入できました。


以上です。