0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RHEL系(AlmaLinux8) オフライン環境での RPM インストール ※ローカルパッケージインストール

Posted at

オフライン環境でのRPMインストール

知り合いの環境が、DMZ(非武装地帯) で外部ネットワーク禁止のところで RPM パッケージをインストールしたいというので調査したときのメモです。

該当のパッケージを検索&ダウンロード

特定のhttpdバージョンをインストールしたいとのことで、まず該当パッケージを検索。

$ sudo yum --showduplicates search httpd

httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 : Apache HTTP Server
httpd-2.4.37-39.module_el8.4.0+778+c970deab.x86_64 : Apache HTTP Server
httpd-2.4.37-40.module_el8.5.0+852+0aafc63b.x86_64 : Apache HTTP Server
httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 : Apache HTTP Server
httpd-2.4.37-47.module_el8.6.0+1111+ce6f4ceb.1.x86_64 : Apache HTTP Server
httpd-2.4.37-54.module_el8.8.0+1256+e1598b50.x86_64 : Apache HTTP Server

httpd-2.4.37-30 をインストールしたいので RPMパッケージをローカルにダウンロードする。

$ sudo yum install --downloadonly --destdir . httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64
サブスクリプション管理リポジトリーを更新しています。
コンシューマー識別子を読み込めません

このシステムは、エンタイトルメントサーバーに登録されていません。subscription-manager で登録できます。

メタデータの期限切れの最終確認: 1:24:46 前の 2023年06月18日 11時13分39秒 に実施しました。
依存関係が解決しました。
============================================================================================================================================================================================
 パッケージ                                  アーキテクチャー                バージョン                                                            リポジトリー                       サイズ
============================================================================================================================================================================================
インストール:
 httpd                                       x86_64                          2.4.37-30.module_el8.3.0+462+ba287492.0.1                             appstream                          1.7 M
依存関係のインストール:
 apr                                         x86_64                          1.6.3-12.el8                                                          appstream                          129 k
 apr-util                                    x86_64                          1.6.1-6.el8                                                           appstream                          105 k
 centos-logos-httpd                          noarch                          85.8-2.el8                                                            appstream                           75 k
 httpd-filesystem                            noarch                          2.4.37-30.module_el8.3.0+462+ba287492.0.1                             appstream                           37 k
 httpd-tools                                 x86_64                          2.4.37-30.module_el8.3.0+462+ba287492.0.1                             appstream                          104 k
 mod_http2                                   x86_64                          1.15.7-5.module_el8.6.0+1111+ce6f4ceb                                 appstream                          155 k
弱い依存関係のインストール:
 apr-util-bdb                                x86_64                          1.6.1-6.el8                                                           appstream                           25 k
 apr-util-openssl                            x86_64                          1.6.1-6.el8                                                           appstream                           27 k
モジュールストリームの有効化中:
 httpd                                                                       2.4                                                                                                           

とりあえずローカルにダウンロードできたのを確認する。

$ ll
合計 2384
-rw-r--r-- 1 root root  132592  6月 18 12:38 apr-1.6.3-12.el8.x86_64.rpm
-rw-r--r-- 1 root root  107760  6月 18 12:38 apr-util-1.6.1-6.el8.x86_64.rpm
-rw-r--r-- 1 root root   25120  6月 18 12:38 apr-util-bdb-1.6.1-6.el8.x86_64.rpm
-rw-r--r-- 1 root root   27484  6月 18 12:38 apr-util-openssl-1.6.1-6.el8.x86_64.rpm
-rw-r--r-- 1 root root   76472  6月 18 12:38 centos-logos-httpd-85.8-2.el8.noarch.rpm
-rw-r--r-- 1 root root 1749807  6月 18 12:38 httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64.rpm
-rw-r--r-- 1 root root   37567  6月 18 12:38 httpd-filesystem-2.4.37-30.module_el8.3.0+462+ba287492.0.1.noarch.rpm
-rw-r--r-- 1 root root  106363  6月 18 12:38 httpd-tools-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64.rpm
-rw-r--r-- 1 root root  158227  6月 18 12:38 mod_http2-1.15.7-5.module_el8.6.0+1111+ce6f4ceb.x86_64.rpm

RPM パッケージを転送&インストールのテスト

RPM パッケージを転送します。そして RPM パッケージのテストを実施します。

httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64.rpm だけをテストインストールしてみます。依存があるのでエラーがでることを確認できます。

$ sudo rpm -ivh --test httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64.rpm
エラー: 依存性の欠如:
        httpd-filesystem は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています
        httpd-filesystem = 2.4.37-30.module_el8.3.0+462+ba287492.0.1 は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています
        httpd-tools = 2.4.37-30.module_el8.3.0+462+ba287492.0.1 は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています
        libapr-1.so.0()(64bit) は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています
        libaprutil-1.so.0()(64bit) は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています
        mod_http2 は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています
        system-logos-httpd は httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64 に必要とされています

依存のあるパッケージを列挙します。

$ sudo rpm -ivh --test httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64.rpm apr-1.6.3-12.el8.x86_64.rpm apr-util-1.6.1-6.el8.x86_64.rpm apr-util-bdb-1.6.1-6.el8.x86_64.rpm apr-util-openssl-1.6.1-6.el8.x86_64.rpm centos-logos-httpd-85.8-2.el8.noarch.rpm httpd-filesystem-2.4.37-30.module_el8.3.0+462+ba287492.0.1.noarch.rpm httpd-tools-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64.rpm mod_http2-1.15.7-5.module_el8.6.0+1111+ce6f4ceb.x86_64.rpm
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]

うん。大丈夫そう。--test を外してインストールしましょう。

参考にさせて頂いたサイト様

RHEL 8でdnfコマンドでRPMのダウンロードのみを行う!
yum|パッケージの検索
Yum で特定のバージョンを指定してソフトウェアをインストールする方法
RPMパッケージのインストールテストを行う

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?