使い方: rpm [オプション...]
--quiet
Query/Verify package selection options:
-a, --all 全てのパッケージについて問い合わせ/検証します。
-f, --file
Usage: rpm [OPTION...]
--quiet
Query/Verify package selection options:
-a, --all query/verify all packages
-f, --file query/verify package(s) owning file
-g, --group query/verify package(s) in group
-p, --package query/verify a package file
-W, --ftswalk query/verify package(s) from TOP file tree
walk
--pkgid query/verify package(s) with package
identifier
--hdrid query/verify package(s) with header
identifier
--fileid query/verify package(s) with file identifier
--specfile query a spec file
--triggeredby query the package(s) triggered by the
package
--whatrequires query/verify the package(s) which require a
dependency
--whatprovides query/verify the package(s) which provide a
dependency
--nomanifest do not process non-package files as
manifests
Query options (with -q or --query):
-c, --configfiles list all configuration files
-d, --docfiles list all documentation files
--dump dump basic file information
-l, --list list files in package
--queryformat=QUERYFORMAT use the following query format
-s, --state display the states of the listed files
Verify options (with -V or --verify):
--nofiledigest don't verify digest of files
--nomd5 don't verify digest of files
--nofiles don't verify files in package
--nodeps don't verify package dependencies
--noscript don't execute verify script(s)
File tree walk options (with --ftswalk):
--comfollow follow command line symlinks
--logical logical walk
--nochdir don't change directories
--nostat don't get stat info
--physical physical walk
--seedot return dot and dot-dot
--xdev don't cross devices
--whiteout return whiteout information
Signature options:
--addsign sign package(s) (identical to --resign)
-K, --checksig verify package signature(s)
--delsign delete package signatures
--import import an armored public key
--resign sign package(s) (identical to --addsign)
--nodigest don't verify package digest(s)
--nosignature don't verify package signature(s)
Database options:
--initdb initialize database
--rebuilddb rebuild database inverted lists from
installed package headers
Install/Upgrade/Erase options:
--aid add suggested packages to transaction
--allfiles install all files, even configurations
which might otherwise be skipped
--allmatches remove all packages which match
RPM(8) RPM(8)
名前
rpm - RPM パッケージマネージャ
書式
パッケージの検索と検査:
rpm {-q|--query} [select-options] [query-options]
rpm {-V|--verify} [select-options] [verify-options]
rpm --import PUBKEY ...
rpm {-K|--checksig} [--nogpg] [--nopgp] [--nomd5]
PACKAGE_FILE ...
パッケージのインストール・アップグレード・削除:
rpm {-i|--install} [install-options] PACKAGE_FILE ...
rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
rpm {-F|--freshen} [install-options] PACKAGE_FILE ...
rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts]
[--notriggers] [--test] PACKAGE_NAME ...
その他:
rpm {--initdb|--rebuilddb}
rpm {--addsign|--resign} PACKAGE_FILE ...
rpm {--querytags|--showrc}
rpm {--setperms|--setugids} PACKAGE_NAME ...
select-options(選択オプション)
[PACKAGE_NAME] [-a,--all] [-f,--file FILE]
[-g,--group GROUP] [-p,--package PACKAGE_FILE]
[--fileid MD5] [--hdrid SHA1] [--pkgid MD5] [--tid TID]
[--querybynumber HDRNUM] [--triggerdby PACKAGE_NAME]
[--whatprovies CAPABILITY] [--whatrequires CAPABILITY]
query-options(検索オプション)
[--changelog] [-c,--configfiles] [-d,--docfiles] [--dump]
[--filesbypkg] [-i,--info] [--last] [-l,--list]
[--provides] [--qf,--queryformat QUERYFMT] [-R,--requires]
[--scripts] [-s,--state] [--triggers,--triggerscripts]
verify-options(検査オプション)
[--nodeps] [--nofiles] [--noscripts] [--nodigest]
[--nosignature] [--nolinkto] [--nomd5] [--nosize]
[--nouser] [--nogroup] [--nomtime] [--nomode] [--nordev]
install-options(インストールオプション)
[--aid] [--allfiles] [--badreloc] [--excludepath OLDPATH]
[--excludedocs] [--force] [-h,--hash] [--ignoresize]
[--ignorearch] [--ignoreos] [--includedocs] [--justdb]
[--nodeps] [--nodigest] [--nosignature] [--nosuggest]
[--noorder] [--noscripts] [--notriggers]
[--oldpackage] [--percent] [--prefix NEWPATH]
[--relocate OLDPATH=NEWPATH]
[--replacefiles] [--replacepkgs] [--test]
説明
rpm は強力な パッケージマネージャであり、個々のソフトウェアパッケージを
ビルド・インストール・検索・検査・更新・削除するのに使うことができる。
パ ッケージはファイルのアーカイブと、アーカイブされたファイルのインスト
ール・アンインストールに使われるメタデータからなる。メタデータは補助 ス
クリプト、ファイル属性、そしてパッケージの説明に関する情報からなる。 パ
ッケージには 2 種類ある。インストールするためのソフトウェアをカプセル化
す るのに使われるバイナリパッケージと、バイナリパッケージを生成するのに
必要なレシピとソースコードからなるソースパッケージである。
以下の基本モードのいずれかが選択されなければならない: 検索、検査、署 名
の 検査、インストール/アップグレード/更新、アンインストール、データベー
スの初期化、データベースの再作成、再署名、署名の追加、所有者/グループの
設定、検索タグの表示、設定の表示。
共通のオプション
次のオプションはすべてのモードで使用することができる。
-?, --help
使い方を通常のものよりも長く表示する。
--version
使用される rpm のバージョン番号からなる 1 行を表示する。
--quiet
できるだけ少なく表示する。通常は、エラーメッセージだけが表示され
る。
-v より多くの情報を表示する。通常は、ルーチンの進捗メッセージが表示
される。
-vv 沢山の汚いデバッグ情報を表示する。
--rcfile FILELIST
コ ロン(‘:’)で区切られた FILELIST の各ファイルは、設定情報として
rpm によって順番に読み込まれる。 FILELIST の デ フ ォ ル ト は
/usr/lib/rpm/rpmrc:/usr/lib/rpm/redhat/rpmrc:~/.rpmrc である。
--pipe CMD
rpm コマンドの出力を CMD へパイプする。
--dbpath DIRECTORY
デ ータベースのパスに、デフォルトの /var/lib/rpm ではなく DIREC-
TORY を使う。
--root DIRECTORY
すべてのオプションに対し、 DIRECTORY をルートとしたファイルシ ス
テムを使う。これは、依存性のチェックとすべてのスクリプト(群) (例
えば、パッケージインストール時の %post や、パッケージビルド時 の
%prep など)が DIRECTORY に chroot(2) した後で、 DIRECTORY 内にあ
るデータベースが使用されることを意味する。
インストールとアップグレードのオプション
rpm をインストールするコマンドの一般的な形式は:
rpm {-i|--install} [install-options] PACKAGE_FILE ...
これは新しいパッケージをインストールする。
アップグレードするコマンドの一般的な形式は:
rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
これは現在インストールされているパッケージを新しいバージョンにアップ グ
レ ードするか、パッケージをインストールする。新しいパッケージがインスト
ールされたら他のすべてのバージョンのものが削除されることを除けば、イ ン
ストールと同じである。
rpm {-F|--freshen} [install-options] PACKAGE_FILE ...
こ れは以前のバージョンが、現在インストールされている場合にのみパッケー
ジを更新する。
PACKAGE_FILE には ftp または http の URL を指定することが可能で、その場
合 に はパッケージをインストールする前にダウンロードする。 rpm 内部での
ftp と http のサポートについての情報は FTP/HTTP オプションの節を参照 の
こと。
--aid 指定されたパッケージを、必要があればトランザンクションに加える。
--allfiles
パッケージ内の missingok ファイルを、存在する/しないにかかわらず
インストールまたはアップグレードする。
--badreloc
--relocate と一緒に使われると、パッケージ再配置のヒント(群)の中
にその OLDPATH が含まれていなくても、すべてのファイルパスの再 配
置を許可する。
--excludepath OLDPATH
パスの名前が OLDPATH で始まるファイルをインストールしない。
--excludedocs
(man ページ、tenxinfo 文書を含めた)文書であるとマーク付されたフ
ァイルをインストールしない。
--force
--replacepkgs, --replacefiles, --oldpackage の組み合わせに同じ。
-h, --hash
パ ッ ケージアーカイブから取り出されるにつれ、50個のハッシュマー
ク("#") を表示する。 -v|--verbose と一緒に使えば、よりよい表示が
得られる。
--ignoresize
パッケージをインストールする前に、ディスクに十分な空きがあるかの
チェックをファイルシステムに対して行わない。
--ignorearch
バイナリパッケージのアーキテクチャと、そのホストのアーキテクチャ
が一致しなくても、インストールやアップグレードを行う。
--ignoreos
バイナリパッケージのOSと、そのホストのOSが一致しなくても、インス
トールやアップグレードを行う。
--includedocs
文書ファイルをインストールする。これはデフォルトの動作である。
--justdb
データベースだけを更新し、ファイルシステムを更新しない。
--nodigest
読み込み時にパッケージまたはへッダのダイジェストを検査しない。
--nosignature
読み込み時にパッケージまたはへッダの署名を検査しない。
--nodeps
パッケージのインストールやアップグレードの前に、依存性のチェック
をしない。
--nosuggest
不明な依存性を解消するパッケージ(群)を提案しない。
--noorder
パッケージのインストール順を変更しない。通常は依存性を満たすため
に、パッケージのリストは並び替えられる。
--noscriopts
--nopre
--nopost
--nopreun
--nopostun
それぞれ同じ名前を持ったスクリプトを実行しない。 --noscripts オ
プションは
--nopre --nopost --nopreun --nopostun
に等しく、対応する %pre, %post, %preun, %postun スクリプト(群)を
実行しない。
--notriggers
--notriggerin
--notriggerun
--notriggerpostun
指定された種類のトリガースクリプトを実行しない。 --notriggers オ
プションは
--notriggerin --notriggerun --notriggerpostun
に等しく、対応する %triggerin, %triggerun, %triggerpostun スクリ
プト(群)を実行しない。
--oldpackage
新しいパッケージをそれより古いパッケージでアップグレードできるよ
うにする。
--percent
パッケージアーカイブからファイルが取り出されるにつれて、その割合
をを表示する。これは rpm が他のツールから実行されるのを容易に す
ることを意図している。
--prefix NEWPATH
再 配 置可能なバイナリパッケージにおいて、パッケージの再配置ヒン
ト(群)にあるインストールプレフィックスで始まるファイルのパスを、
NEWPATH に置き換える。
--reloacte OLDPATH=NEWPATH
再 配 置可能なバイナリパッケージにおいて、パッケージの再配置ヒン
ト(群)にある OLDPATH で始まるファイルのパスと NEWPATH で置き換え
る 。パッケージ内で、複数の OLDPATH が再配置されなければならない
のなら、このオプションを繰り返し指定することができる。
--replacefiles
既にインストールされた他のパッケージのファイルを置き換えてしまう
場合でも、パッケージをインストールする。
--replacepkgs
指定されたパッケージのうちのいくつかがシステムに既にインストール
されていても、パッケージをインストールする。
--test パッケージをインストールせず、単にチェックと、潜在的な衝突の報告
を行う。
削除のオプション
rpm を削除するコマンドの一般的な形式は:
rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts]
[--notriggers] [--test] PACKAGE_NAME ...
以下のオプションが使用できる:
--allmatces
PACKAGE_NAME に一致するすべてのバージョンのパッケージを削除する
。
--nodeps
パッケージをアンインストールする前に依存性のチェックをしない。
--noscripts
--nopreun
--nopostun
それぞれ同じ名前を持ったスクリプトを実行しない。 --noscripts オ
プションは
--nopreun --nopostun
に 等しく、対応する %preun と %postun スクリプト(群)を実行しない
。
--notriggers
--notriggerun
--notriggerpostun
指定された種類のトリガースクリプトを実行しない 。 オ プ シ ョ ン
--notriggers は
--notriggerun --notriggerpostun
に等しく、対応する %triggerun と %triggerpostun スクリプト(群)を
実行しない。
--test 実際には何もアンインストールせず挙動だけを見せる。オプション -vv
と共に使えばデバッグに有効である。
検索オプション
rpm 検索の一般的な形式は:
rpm {-q|--query} [select-options] [query-options]
表 示されるパッケージ情報の書式を指定することができる。そうするためには
、
--qf|--queryformat QUERYFMT
オプションを使う。 QUERYFMT が書式文字列である。検索の書式は、標準的 な
printf(3) の書式の修正である。書式は静的な文字列 (改行・タブ・その他の
特殊文字の、C 言語の標準的な文字エスケープを含む)と、 printf(3) 型の 書
式文字列からなる。しかし rpm は表示する型を既に知っているので、型指定は
省略されるべきである。代わりに {} で囲まれた、表示されるへッダーのタ グ
名 が使用される。タグ名に大文字/小文字の区別はなく、タグ名の先頭の RPM-
TAG_ 部分も省略することができる。
以下の :typetag を付加したタグによって、代替の出力書式を要求できる。 現
在、以下の種別がサポートされている:
:armor 公開鍵をASCII文字で表示する。
:base64
バイナリデータを base64 で符号化する。
:date strftime(3)の "%c" 書式を使う。
:day strftime(3)の "%a %b %d %Y" 書式を使う。
:depflags
依存フラグで表示。
:fflags
ファイルフラグで表示。
:hex 16進数で表示。
:octal 8進数で表示。
:perms ファイルの許可属性で表示。
:shescape
スクリプト内で使えるようにシングルクォート(’)でエスケープする。
:triggertype
トリガーの種類を表示。
例 え ば 、検索結果のパッケージ名だけを表示したければ、書式文字列として
%{NAME} を使えばよい。 2 カラムでパッケージ名とディストリビューション情
報を表示したければ %-30{NAME}%{DISTRIBUTUIN} を使えばよい。 (訳注: 端末
によっては末尾に \n が必要である)。引数 --querytags をつけて rpm を実行
すれば、使用できるタグすべてを表示することができる。
検 索 のためのオプションは2種類に分けられる。パッケージの選択と、(訳注:
表示するための)情報の選択である。
パッケージ選択オプション:
PACKAGE_NAME
インストールされている PACKAGE_NAME という名前のパッケー ジ
を検索する。
-a, --all
インストールされているすべてのパッケージを検索する。
-f, --file FILE
FILE を所有するパッケージを検索する。
--fileid MD5
与えられたファイル識別子、すなわち MD5 ダイジェストを持つフ
ァイルを含むパッケージを検索する。
-g, --group GROUP
グループが GROUP であるパッケージを検索する。
--hdrid SHA1
与えられたへッダー識別子、すなわち書き換え不可能なへッダ 領
域に SHA1 ダイジェストををもつパッケージを検索する。
-p, --package PACKAGE_FILE
( インストールされていない)パッケージ PACKAGE_FILE を検索す
る。 PACKAGE_FILE には ftp または http の URL 形式で指定 す
る ことができ、その場合にはパッケージへッダーがダウンロード
されて検索される。 ftp と http のクライアントに関す る rpm
内 部でのサポートについては FTP/HTTP OPTIONS を参照のこと。
PACKAGE_FILE 引数(群)がバイナリパッケージでなければ、それが
ASCII 形式のパッケージのリストを表わすものと解釈される。パ
ッケージのリストファイルでは、’#’ で始まる行はコメントで あ
る 。各行には空白で区切ったパス名展開式が指定可能で、展開さ
れたパスは、検索する PACKAGE_FILE 引数への追加として置換 さ
れる。パス名展開式には URL のリモートのパス名展開も使うこと
ができる。
--pkgid MD5
与えられたパッケージ識別子、すなわちへッダーと内容物との 組
み合わせが MD5 ダイジェストををもつパッケージを検索する。
--querybynumber HDRNUM
デ ータベースの HDRNUM 番目のエントリを直接検索する。デバッ
グにのみ有効である。
--specfile SPECFILE
SPECFILE をそれがパッケージであるかのように解析し、検索する
。 す べての情報が利用できるわけではない(たとえばファイル一
覧)にもかかわらず、 spec ファイルの解析器を書くこと無 し に
spec ファイルから情報を取り出すことがこの種の検索で可能であ
る。
--tid TID
与えられたトランザクション識別子 TID を持つパッケージ(群)を
検索する。現在のところ、unix 時間がトランザクション識別子と
して使われている。一つのトランザクションでインストール・ 削
除されたパッケージ(群)は、すべて共通の識別子を持つ。
--triggerdby PACKAGE_NAME
パ ッケージ(群) PACKAGE_NAME によってトリガーされるパッケー
ジを検索する。
--whatprovides CAPABILITY
CAPABILITY 能力を提供するパッケージを検索する。
--whatrequires CAPABILITY
適切に機能するために CAPABILITY を必要とするパッケージを 検
索する。
パッケージ検索オプション:
--changelog
パッケージの更新情報を表示する。
-c, --configfiles
設定ファイルのみを表示する (-l を指定したものとみなす)。
-d, --docfiles
文書ファイルのみを表示する (-l を指定したものとみなす)。
--dump 以下の形式でファイル情報をダンプする (-l を指定したものとみ
なす)。
パス サイズ 修正時刻 md5ダイジェスト モード \
所有者 グループ 設定ファイル 文書ファイル \
ルートデバイス シンボリックリンク
--filesbypkg
選択されたパッケージごとにファイルを表示する。
-i, --info
名前、バージョン、説明を含めたパッケージ情報を表示する。 こ
れは --queryformat を内部で使用している。
--last パッケージをインストール時刻順に、最新のパッケージが先頭に
なるような順で並べる。
-l, --list
パッケージ内にあるファイルを表示する。
--provides
そのパッケージが提供する能力を表示する。
-R, --requires
そのパッケージが依存するパッケージを表示する。
--scripts
インストール・アンインストールの過程で使用される、パッケ ー
ジ固有のスクリプトを表示する。
-s , --state
パ ッケージ内のファイルの 状態を表示する (-l を指定したもの
とみなす)。各ファイルの状態は normal(正常), not installed(
イ ンストールされていない), replaced(置き換えられた) のいず
れかである。
--triggers, --triggerscripts
パッケージにトリガースクリプトが含まれれば表示する。
検査オプション
rpm を検査するコマンドの一般的な形式は:
rpm {-V|--verify} [select-options] [verify-options]
パッケージの検査では、パッケージ内のインストールされたファイルに関す る
情報と、 rpm データベースに格納されているパッケージのメタデータから得ら
れたファイルに関する情報とを比較する。とりわけ、ファイルのサイ ズ 、MD5
チ ェックサム、許可属性、タイプ、所有者、グループを比較する。インストー
ル時に --excludedocs オプションを使ったために除外された文書ファイルのよ
う に、パッケージからインストールされていないファイルは静かに無視される
。
パッケージ選択オプションは、パッケージ検索のためのものと (パッケージ の
リ ストファイルを引数に指定できることも含め) 一緒である。その他の、検査
モード固有のオプションは:
--nodeps
パッケージの依存性について検査しない。
--nodigest
読み込み時にパッケージやへッダーのダイジェスト値を検査しない。
--nofiles
パッケージ内のファイルのいかなる属性も検査しない。
--noscripts
%verifyscript がもし存在しても実行しない。
--nosignature
読み込み時にパッケージやへッダーの署名を検査しない。
--nolinkto
--nomd5
--nosize
--nouser
--nogroup
--nomtime
--nomode
--nordev
それぞれ関連するファイル属性を検査しない。
出力の形式は 8 個の文字と属性マーク、その後ろにファイル名である。パッケ
ージのへッダーから得られる属性マークは:
c %config 設定ファイル。
d %doc 文書ファイル。
g %ghost ファイル(すなわち、パッケージの内容物としては含まれていないフ
ァイル)。
l %license ライセンスファイル。
r %readme readme ファイル。
各 8 個の文字は、ファイルの属性とデータベースに記録されているその属性の
値との比較の結果を意味している。一つの . (ピリオド) はテストを通過した
こと意味し、一つの ? (クエスチョンマーク) はテストが実施されなかった (
す なわち、ファイルパーミッションにより読み込めなかった) ことを意味する
。でなかれば、 (記憶を助けるために、ボールド化 (emBoldened) されている)
文字は関連する --verify テストに失敗したことを意味する:
S ファイルのサイズ (Size) が異なる
M モード (Mode; 許可属性とファイルの種類) が異なる
5 MD5 チェックサムが異なる
D デバイス (Device) のメジャー/マイナー番号が一致しない
L readLink(2) したパスが一致しない
U 所有者 (User) が異なる
G グループ (Group) が異なる
T 修正時刻 (mTime) が異なる
電子署名とダイジェストの検査
rpm の電子書名の一般的な形式は:
rpm --import PUBKEY ...
rpm {-K|--checksig} [--nogpg] [--nopgp] [--nomd5]
PACKAGE_FILE ...
--checksig オプションは、パッケージの完全性と出所を確認するために PACK-
AGE_FILE に含まれるすべてのダイジェスト値と署名をチェックする。現在では
パ ッケージが読み込まれたときはいつでも署名が検査される。 --checksig の
方はパッケージに付随するすべてのダイジェスト値と署名を検査するのに有 効
である。
公開鍵がなければ電子署名の検査はできない。 --import を使えば rpm データ
ベースに ASCII 形式での公開鍵を追加できる。取り込まれた公開鍵はあるへッ
ダ ーへと運ばれ、パッケージ管理のように厳密な鍵リング管理が実行される。
例として、その時点で取り込まれているすべての公開鍵は以下を実行するこ と
で表示できる。
rpm -qa gpg-pubkey*
( 訳注: 多くの場合 "*" はシェルによってメタ文字として解釈されるので、実
際には rpm -qa "gpg-pubkey*" のようにクォーティングする必要がある)
取り込んだ、特定の公開鍵に関する詳細は検索によって表示することができ る
。 Red Hat の GPG/DSA 鍵に関する情報は:
rpm -qi gpg-pubkey-db42a60e
最 後に、パッケージでそうできるように、取り込んだ公開鍵を削除することが
できる。以下は Red Hat の GPG/DSA 鍵を削除する。
rpm -e gpg-pubkey-db42a60e
パッケージへの署名
rpm {--addsign|--resign} PACKAGE_FILE ...
オプション --addsign と --resign の両方とも、与えられた各パ ッ ケ ー ジ
PACKAGE_FILE に対する新たな署名を生成・挿入し、既に存在する署名があれば
置き換える。歴史的な理由により二つのオプションが存在するが、現在では そ
の動作に違いはない。
パッケージへの署名に GPG を使用する
GPG を使ってパッケージに署名するためには、 rpm が GPG を実行するように
設定されていなければならず、また、適切な鍵で鍵リングを探すことができ な
け ればならない。 rpm はデフォルトで、 GPG が鍵の環を探すのと同じ規則、
すなわち環境変数 $GPGPATH を使用する。 GPG が期待する場所に鍵リングが無
い場合には、使用する GPG 鍵リングの場所を %_gpg_path マクロに設定する必
要がある。
過去のバージョンの GPG, PGP, rpm との互換性のために、 V3 OpenPGP 署名パ
ケ ットのみが設定されなければならない。 DSA と RSA の検査アルゴリズムの
どちらも使うことができるが、 DSA の方が好ましい。
作成したパッケージに自分自身で署名できるようにしたければ、公開鍵と秘 密
鍵のペアを作成しておくことも必要である (GPG のマニュアルを見ること)。ま
た、以下の rpm マクロを設定することも必要であろう。
%_signature
署名の形式。現在のところ gpg と pgp のみがサポートされている。
%_gpg_name
パッケージに署名するのに使用したい鍵のユーザ名。
例えば、実行ファイルが /usr/bin/gpg で、鍵リングが /etc/rpm/.gpg にあり
、 その中のユーザ "John Doe
RPM(8) RPM(8)
NAME
rpm - RPM Package Manager
SYNOPSIS
QUERYING AND VERIFYING PACKAGES:
rpm {-q|--query} [select-options] [query-options]
rpm {-V|--verify} [select-options] [verify-options]
rpm --import PUBKEY ...
rpm {-K|--checksig} [--nosignature] [--nodigest]
PACKAGE_FILE ...
INSTALLING, UPGRADING, AND REMOVING PACKAGES:
rpm {-i|--install} [install-options] PACKAGE_FILE ...
rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
rpm {-F|--freshen} [install-options] PACKAGE_FILE ...
rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts]
[--notriggers] [--test] PACKAGE_NAME ...
MISCELLANEOUS:
rpm {--initdb|--rebuilddb}
rpm {--addsign|--resign} PACKAGE_FILE ...
rpm {--querytags|--showrc}
rpm {--setperms|--setugids} PACKAGE_NAME ...
select-options
[PACKAGE_NAME] [-a,--all] [-f,--file FILE]
[-g,--group GROUP] {-p,--package PACKAGE_FILE]
[--fileid ID] [--hdrid SHA1] [--pkgid MD5] [--tid TID]
[--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME]
[--whatprovides CAPABILITY] [--whatrequires CAPABILITY]
query-options
[--changelog] [-c,--configfiles] [-d,--docfiles] [--dump]
[--filesbypkg] [-i,--info] [--last] [-l,--list]
[--provides] [--qf,--queryformat QUERYFMT]
[-R,--requires] [--obsoletes] [--scripts] [-s,--state]
[--triggers,--triggerscripts]
verify-options
[--nodeps] [--nofiles] [--noscripts]
[--nodigest] [--nosignature]
[--nolinkto] [--nofiledigest] [--nosize] [--nouser]
[--nogroup] [--nomtime] [--nomode] [--nordev]
[--nocaps]
install-options
[--aid] [--allfiles] [--badreloc] [--excludepath OLDPATH]
[--excludedocs] [--force] [-h,--hash]
[--ignoresize] [--ignorearch] [--ignoreos]
[--includedocs] [--justdb] [--nodeps]
[--nodigest] [--nosignature] [--nosuggest]
[--noorder] [--noscripts] [--notriggers]
[--oldpackage] [--percent] [--prefix NEWPATH]
[--relocate OLDPATH=NEWPATH]
[--replacefiles] [--replacepkgs]
[--test]
DESCRIPTION
rpm is a powerful Package Manager, which can be used to build, install,
query, verify, update, and erase individual software packages. A pack-
age consists of an archive of files and meta-data used to install and
erase the archive files. The meta-data includes helper scripts, file
attributes, and descriptive information about the package. Packages
come in two varieties: binary packages, used to encapsulate software to
be installed, and source packages, containing the source code and
recipe necessary to produce binary packages.
One of the following basic modes must be selected: Query, Verify, Sig-
nature Check, Install/Upgrade/Freshen, Uninstall, Initialize Database,
Rebuild Database, Resign, Add Signature, Set Owners/Groups, Show Query-
tags, and Show Configuration.
GENERAL OPTIONS
These options can be used in all the different modes.
-?, --help
Print a longer usage message then normal.
--version
Print a single line containing the version number of rpm being
used.
--quiet
Print as little as possible - normally only error messages will
be displayed.
-v Print verbose information - normally routine progress messages
will be displayed.
-vv Print lots of ugly debugging information.
--rcfile FILELIST
Each of the files in the colon separated FILELIST is read
sequentially by rpm for configuration information. Only the
first file in the list must exist, and tildes will be expanded
to the value of $HOME. The default FILELIST is
/usr/lib/rpm/rpmrc:/usr/lib/rpm/red-
hat/rpmrc:/etc/rpmrc:~/.rpmrc.
--pipe CMD
Pipes the output of rpm to the command CMD.
--dbpath DIRECTORY
Use the database in DIRECTORY rather than the default path
/var/lib/rpm
--root DIRECTORY
Use the file system tree rooted at DIRECTORY for all operations.
Note that this means the database within DIRECTORY will be used
for dependency checks and any scriptlet(s) (e.g. %post if
installing, or %prep if building, a package) will be run after a
chroot(2) to DIRECTORY.
-D, --define=’MACRO EXPR’
Defines MACRO with value EXPR.
-E, --eval=’EXPR’
Prints macro expansion of EXPR.
INSTALL AND UPGRADE OPTIONS
In these options, PACKAGE_FILE can be either rpm binary file or ASCII
package manifest (see PACKAGE SELECTION OPTIONS), and may be specified
as an ftp or http URL, in which case the package will be downloaded
before being installed. See FTP/HTTP OPTIONS for information on rpm’s
internal ftp and http client support.
The general form of an rpm install command is
rpm {-i|--install} [install-options] PACKAGE_FILE ...
This installs a new package.
The general form of an rpm upgrade command is
rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
This upgrades or installs the package currently installed to a newer
version. This is the same as install, except all other version(s) of
the package are removed after the new package is installed.
rpm {-F|--freshen} [install-options] PACKAGE_FILE ...
This will upgrade packages, but only ones for which an earlier version
is installed.
--aid Add suggested packages to the transaction set when needed.
--allfiles
Installs or upgrades all the missingok files in the package,
regardless if they exist.
--badreloc
Used with --relocate, permit relocations on all file paths, not
just those OLDPATH’s included in the binary package relocation
hint(s).
--excludepath OLDPATH
Don’t install files whose name begins with OLDPATH.
--excludedocs
Don’t install any files which are marked as documentation (which
includes man pages and texinfo documents).
--force
Same as using --replacepkgs, --replacefiles, and --oldpackage.
-h, --hash
Print 50 hash marks as the package archive is unpacked. Use
with -v|--verbose for a nicer display.
--ignoresize
Don’t check mount file systems for sufficient disk space before
installing this package.
--ignorearch
Allow installation or upgrading even if the architectures of the
binary package and host don’t match.
--ignoreos
Allow installation or upgrading even if the operating systems of
the binary package and host don’t match.
--includedocs
Install documentation files. This is the default behavior.
--justdb
Update only the database, not the filesystem.
--nodigest
Don’t verify package or header digests when reading.
--nomanifest
Don’t process non-package files as manifests.
--nosignature
Don’t verify package or header signatures when reading.
--nodeps
Don’t do a dependency check before installing or upgrading a
package.
--nosuggest
Don’t suggest package(s) that provide a missing dependency.
--noorder
Don’t reorder the packages for an install. The list of packages
would normally be reordered to satisfy dependencies.
--noscripts
--nopre
--nopost
--nopreun
--nopostun
Don’t execute the scriptlet of the same name. The --noscripts
option is equivalent to
--nopre --nopost --nopreun --nopostun
and turns off the execution of the corresponding %pre, %post,
%preun, and %postun scriptlet(s).
--notriggers
--notriggerin
--notriggerun
--notriggerpostun
Don’t execute any trigger scriptlet of the named type. The
--notriggers option is equivalent to
--notriggerin --notriggerun --notriggerpostun
and turns off execution of the corresponding %triggerin, %trig-
gerun, and %triggerpostun scriptlet(s).
--oldpackage
Allow an upgrade to replace a newer package with an older one.
--percent
Print percentages as files are unpacked from the package
archive. This is intended to make rpm easy to run from other
tools.
--prefix NEWPATH
For relocatable binary packages, translate all file paths that
start with the installation prefix in the package relocation
hint(s) to NEWPATH.
--relocate OLDPATH=NEWPATH
For relocatable binary packages, translate all file paths that
start with OLDPATH in the package relocation hint(s) to NEWPATH.
This option can be used repeatedly if several OLDPATH’s in the
package are to be relocated.
--replacefiles
Install the packages even if they replace files from other,
already installed, packages.
--replacepkgs
Install the packages even if some of them are already installed
on this system.
--test Do not install the package, simply check for and report poten-
tial conflicts.
ERASE OPTIONS
The general form of an rpm erase command is
rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts] [--notriggers]
[--test] PACKAGE_NAME ...
The following options may also be used:
--allmatches
Remove all versions of the package which match PACKAGE_NAME.
Normally an error is issued if PACKAGE_NAME matches multiple
packages.
--nodeps
Don’t check dependencies before uninstalling the packages.
--noscripts
--nopreun
--nopostun
Don’t execute the scriptlet of the same name. The --noscripts
option during package erase is equivalent to
--nopreun --nopostun
and turns off the execution of the corresponding %preun, and
%postun scriptlet(s).
--notriggers
--notriggerun
--notriggerpostun
Don’t execute any trigger scriptlet of the named type. The
--notriggers option is equivalent to
--notriggerun --notriggerpostun
and turns off execution of the corresponding %triggerun, and
%triggerpostun scriptlet(s).
--test Don’t really uninstall anything, just go through the motions.
Useful in conjunction with the -vv option for debugging.
QUERY OPTIONS
The general form of an rpm query command is
rpm {-q|--query} [select-options] [query-options]
You may specify the format that package information should be printed
in. To do this, you use the
--qf|--queryformat QUERYFMT
option, followed by the QUERYFMT format string. Query formats are mod-
ified versions of the standard printf(3) formatting. The format is made
up of static strings (which may include standard C character escapes
for newlines, tabs, and other special characters) and printf(3) type
formatters. As rpm already knows the type to print, the type specifier
must be omitted however, and replaced by the name of the header tag to
be printed, enclosed by {} characters. Tag names are case insensitive,
and the leading RPMTAG_ portion of the tag name may be omitted as well.
Alternate output formats may be requested by following the tag with
:typetag. Currently, the following types are supported:
:armor Wrap a public key in ASCII armor.
:arraysize
Display number of elements in array tags.
:base64
Encode binary data using base64.
:date Use strftime(3) "%c" format.
:day Use strftime(3) "%a %b %d %Y" format.
:depflags
Format dependency comparison operator.
:deptype
Format dependency type.
:fflags
Format file flags.
:fstate
Format file state.
:hex Format in hexadecimal.
:octal Format in octal.
:perms Format file permissions.
:pgpsig
Display signature fingerprint and time.
:shescape
Escape single quotes for use in a script.
:triggertype
Display trigger suffix.
:vflags
File verification flags.
:xml Wrap data in simple xml markup.
For example, to print only the names of the packages queried, you could
use %{NAME} as the format string. To print the packages name and dis-
tribution information in two columns, you could use %-30{NAME}%{DISTRI-
BUTION}. rpm will print a list of all of the tags it knows about when
it is invoked with the --querytags argument.
There are two subsets of options for querying: package selection, and
information selection.
PACKAGE SELECTION OPTIONS:
PACKAGE_NAME
Query installed package named PACKAGE_NAME.
-a, --all
Query all installed packages.
-f, --file FILE
Query package owning FILE.
--fileid ID
Query package that contains a given file identifier. The ID is
the digest of the file contents. For different packages differ-
ent hash algorithms may have been used (MD5, SHA1, SHA256,
SHA384, SHA512, ...)
-g, --group GROUP
Query packages with the group of GROUP.
--hdrid SHA1
Query package that contains a given header identifier, i.e. the
SHA1 digest of the immutable header region.
-p, --package PACKAGE_FILE
Query an (uninstalled) package PACKAGE_FILE. The PACKAGE_FILE
may be specified as an ftp or http style URL, in which case the
package header will be downloaded and queried. See FTP/HTTP
OPTIONS for information on rpm’s internal ftp and http client
support. The PACKAGE_FILE argument(s), if not a binary package,
will be interpreted as an ASCII package manifest unless --noman-
ifest option is used. In manifests, comments are permitted,
starting with a ’#’, and each line of a package manifest file
may include white space separated glob expressions, including
URL’s, that will be expanded to paths that are substituted in
place of the package manifest as additional PACKAGE_FILE argu-
ments to the query.
--pkgid MD5
Query package that contains a given package identifier, i.e. the
MD5 digest of the combined header and payload contents.
--querybynumber HDRNUM
Query the HDRNUMth database entry directly; this is useful only
for debugging.
--specfile SPECFILE
Parse and query SPECFILE as if it were a package. Although not
all the information (e.g. file lists) is available, this type of
query permits rpm to be used to extract information from spec
files without having to write a specfile parser.
--tid TID
Query package(s) that have a given TID transaction identifier. A
unix time stamp is currently used as a transaction identifier.
All package(s) installed or erased within a single transaction
have a common identifier.
--triggeredby PACKAGE_NAME
Query packages that are triggered by package(s) PACKAGE_NAME.
--whatprovides CAPABILITY
Query all packages that provide the CAPABILITY capability.
--whatrequires CAPABILITY
Query all packages that require CAPABILITY for proper function-
ing.
PACKAGE QUERY OPTIONS:
--changelog
Display change information for the package.
-c, --configfiles
List only configuration files (implies -l).
-d, --docfiles
List only documentation files (implies -l).
--dump Dump file information as follows (implies -l):
path size mtime digest mode owner group isconfig isdoc rdev symlink
--filesbypkg
List all the files in each selected package.
-i, --info
Display package information, including name, version, and
description. This uses the --queryformat if one was specified.
--last Orders the package listing by install time such that the latest
packages are at the top.
-l, --list
List files in package.
--provides
List capabilities this package provides.
-R, --requires
List capabilities on which this package depends.
--obsoletes
List packages this package obsoletes.
--scripts
List the package specific scriptlet(s) that are used as part of
the installation and uninstallation processes.
-s, --state
Display the states of files in the package (implies -l). The
state of each file is one of normal, not installed, or replaced.
--triggers, --triggerscripts
Display the trigger scripts, if any, which are contained in the
package.
VERIFY OPTIONS
The general form of an rpm verify command is
rpm {-V|--verify} [select-options] [verify-options]
Verifying a package compares information about the installed files in
the package with information about the files taken from the package
metadata stored in the rpm database. Among other things, verifying
compares the size, digest, permissions, type, owner and group of each
file. Any discrepancies are displayed. Files that were not installed
from the package, for example, documentation files excluded on instal-
lation using the "--excludedocs" option, will be silently ignored.
The package selection options are the same as for package querying
(including package manifest files as arguments). Other options unique
to verify mode are:
--nodeps
Don’t verify dependencies of packages.
--nodigest
Don’t verify package or header digests when reading.
--nofiles
Don’t verify any attributes of package files.
--noscripts
Don’t execute the %verifyscript scriptlet (if any).
--nosignature
Don’t verify package or header signatures when reading.
--nolinkto
--nofiledigest (formerly --nomd5)
--nosize
--nouser
--nogroup
--nomtime
--nomode
--nordev
Don’t verify the corresponding file attribute.
The format of the output is a string of 8 characters, a possible
attribute marker:
c %config configuration file.
d %doc documentation file.
g %ghost file (i.e. the file contents are not included in the package payload).
l %license license file.
r %readme readme file.
from the package header, followed by the file name. Each of the 8
characters denotes the result of a comparison of attribute(s) of the
file to the value of those attribute(s) recorded in the database. A
single "." (period) means the test passed, while a single "?" (question
mark) indicates the test could not be performed (e.g. file permissions
prevent reading). Otherwise, the (mnemonically emBoldened) character
denotes failure of the corresponding --verify test:
S file Size differs
M Mode differs (includes permissions and file type)
5 digest (formerly MD5 sum) differs
D Device major/minor number mismatch
L readLink(2) path mismatch
U User ownership differs
G Group ownership differs
T mTime differs
P caPabilities differ
DIGITAL SIGNATURE AND DIGEST VERIFICATION
The general forms of rpm digital signature commands are
rpm --import PUBKEY ...
rpm {--checksig} [--nosignature] [--nodigest]
PACKAGE_FILE ...
The --checksig option checks all the digests and signatures contained
in PACKAGE_FILE to ensure the integrity and origin of the package. Note
that signatures are now verified whenever a package is read, and
--checksig is useful to verify all of the digests and signatures asso-
ciated with a package.
Digital signatures cannot be verified without a public key. An ASCII
armored public key can be added to the rpm database using --import. An
imported public key is carried in a header, and key ring management is
performed exactly like package management. For example, all currently
imported public keys can be displayed by:
rpm -qa gpg-pubkey*
Details about a specific public key, when imported, can be displayed by
querying. Here’s information about the Red Hat GPG/DSA key:
rpm -qi gpg-pubkey-db42a60e
Finally, public keys can be erased after importing just like packages.
Here’s how to remove the Red Hat GPG/DSA key
rpm -e gpg-pubkey-db42a60e
SIGNING A PACKAGE
rpm --addsign|--resign PACKAGE_FILE ...
Both of the --addsign and --resign options generate and insert new sig-
natures for each package PACKAGE_FILE given, replacing any existing
signatures. There are two options for historical reasons, there is no
difference in behavior currently.
USING GPG TO SIGN PACKAGES
In order to sign packages using GPG, rpm must be configured to run GPG
and be able to find a key ring with the appropriate keys. By default,
rpm uses the same conventions as GPG to find key rings, namely the
$GNUPGHOME environment variable. If your key rings are not located
where GPG expects them to be, you will need to configure the macro
%_gpg_path to be the location of the GPG key rings to use.
For compatibility with older versions of GPG, PGP, and rpm, only V3
OpenPGP signature packets should be configured. Either DSA or RSA ver-
ification algorithms can be used, but DSA is preferred.
If you want to be able to sign packages you create yourself, you also
need to create your own public and secret key pair (see the GPG man-
ual). You will also need to configure the rpm macros
%_signature
The signature type. Right now only gpg and pgp are supported.
%_gpg_name
The name of the "user" whose key you wish to use to sign your
packages.
For example, to be able to use GPG to sign packages as the user "John
Doe
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa