すでにインストールされているコマンドのRPMパッケージをダウンロードする

すでにインストールされているコマンドのRPMパッケージをダウンロードする

私はCentOSマシンを持っており、すでにopenssl-develをインストールしています。

$ yum install openssl-devel 

すべての依存パッケージがダウンロードされ、インストールされました。これで、すべての RPM パッケージが必要になります。RPM パッケージのみをダウンロードすることは可能ですか? 次のようにすると:

 $ yum install  openssl-devel -y --downloadonly 

それは言う

Package 1:openssl-devel-1.0.1e-4.fc18.x86_64 already installed and latest version

すでにインストールされているためです。

これらの RPM パッケージを同じシステムにダウンロードする方法を知っている人はいますか?

答え1

スイッチを使用して、すでにインストールされている RPM のパッケージをダウンロードすることができます--downloadonly。yum がパッケージがすでにインストールされているかどうかを確認する前にこの設定をチェックしない理由はわかりませんが、ツールの基礎となるアーキテクチャが原因である可能性があります。

とにかく、あなたがする必要があるのは、yumに再インストールその包み:

yum --downloadonly --downloaddir=/tmp/rpm_files/ reinstall package_name

もちろん、yum はこのパッケージ専用にどの依存関係がインストールされたかはわかりません。そのため、RPM を取得して別のシステムにインストールしようとすると、一部の依存関係が欠落する可能性があります。依存関係グラフ全体を調べる方法はいくつかあり、これは SE の他の場所で既に説明されていると思います。

答え2

yumdownloaderin はyum-utils渡されたパッケージをダウンロードするか、オプションでパッケージをダウンロードできる URL を生成します。

答え3

あなたはレポトラックyum-utilsパッケージのコマンド。依存関係ツリー全体がダウンロードされます。すでにインストールされている場合でも

例:

sudo yum install yum-utils      # Install yum-utils
sudo repotrack openssl-devel    # Download all dependencies for openssl-devel


サンプル出力:

[sbadra@rhel6 ~]$ sudo yum install openssl-devel
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Setting up Install Process
Package openssl-devel-1.0.1e-57.el6.x86_64 already installed and latest version
Nothing to do

[sbadra@rhel6 ~]$ sudo repotrack openssl-devel
Downloading audit-libs-2.4.5-6.el6.x86_64.rpm
Downloading audit-libs-2.4.5-6.el6.i686.rpm
Downloading basesystem-10.0-4.el6.noarch.rpm
Downloading bash-4.1.2-48.el6.x86_64.rpm
Downloading ca-certificates-2017.2.14-65.0.1.el6_9.noarch.rpm
Downloading chkconfig-1.3.49.5-1.el6.x86_64.rpm
Downloading coreutils-8.4-46.el6.x86_64.rpm
Downloading coreutils-libs-8.4-46.el6.x86_64.rpm
.... more packages ....
Downloading openssl-1.0.1e-57.el6.i686.rpm
Downloading openssl-1.0.1e-57.el6.x86_64.rpm
Downloading openssl-devel-1.0.1e-57.el6.i686.rpm
Downloading openssl-devel-1.0.1e-57.el6.x86_64.rpm
.... more packages ....
Downloading sed-4.2.1-10.el6.x86_64.rpm
Downloading setup-2.8.14-23.el6.noarch.rpm
Downloading tzdata-2018c-1.el6.noarch.rpm
Downloading zlib-1.2.3-29.el6.x86_64.rpm
Downloading zlib-1.2.3-29.el6.i686.rpm
Downloading zlib-devel-1.2.3-29.el6.i686.rpm
Downloading zlib-devel-1.2.3-29.el6.x86_64.rpm

答え4

私がやっていることは次のとおりです:

sudo yum install --config=./yum.conf 
  --installroot=/tmp/f541Sdex 
  --downloadonly 
  --downloaddir /tmp/DL-e25xds 
  $(cat list-of-packages)

関連情報