yumdownloader~何かと便利な yum-utils を使ってみる〜

yumのようなパッケージ管理ソフトウェアを使ってしまうと,その便利さに取りつかれてしまいます.


ソースコードからのインストールなら,ソースコードを /usr/local/src に保存しておく習慣がありますが,
yumを使っていると『構築時のRPMファイルを保存しておく』ことが疎かになりがちだなと感じていました.


そして,プログラム言語などバージョンを厳密にしていく必要のあるものは,神経質に保存しておく必要があると思うのです!!


以上が長い前置きで,今回は,『RPMを簡単に保存する』というコマンドを紹介します.

yum-utilsとは

名前から察する通り,yumに関するユーティリティ郡です.
インストールされていない場合は,yum-utilsパッケージをインストールします.

[root@ns1 ~]# yum install yum-utils


manからの抜粋なので英語ですが,ざっと以下のことができます.

debuginfo-install - install debuginfo packages and their dependencies
package-cleanup - manage package cleanup, duplicates, orphaned packages and outstanding dependency problems
repo-graph - outputs a full package dependency list in dot format
repo-rss - generates an RSS feed from one or more repositories
repoclosure - reads metadata of repositories, checks dependencies and displays list of unresolved dependencies
repodiff - takes two or more repositories, returns a list of added, removed or changed packages
repomanage - manages a directory of rpm packages, returns a list of newest or oldest packages in a directory
repoquery - query yum repositories and get additional information on the them
reposync - synchronize a remote yum repository to a local directory using yum to retrieve packages
repotrack - track packages and its dependencies and downloads them
yum-builddep - installs missing dependencies to build a specified package
yum-complete-transaction - finds incomplete or aborted yum transactions and attempts to complete them
yumdownloader - downloads packages from yum repositories including source RPMs

yumdownloaderとは

yum-utilsの中で(個人的に)一番使うコマンドです.使い方もとても簡単.

[user1@ns1 ~/rpms] $ /usr/bin/yumdownloader php
Loaded plugins: fastestmirror
php-5.1.6-34.el5_8.i386.rpm                                                                                | 2.3 MB     00:00
[user1@ns1 ~/rpms] $ ll
合計 2376
-rw-r--r-- 1 user1 user1 2424902  58 06:09 php-5.1.6-34.el5_8.i386.rpm


実際にインストールするわけではないので,一般ユーザ権限でも利用できるというのもストロングポイントですね.



私はいつもこんな感じで構築時のRPMをバックアップしていますという紹介でした.