RPM 是用來管理您的系統與診斷並修復問題很有用的工具,為了要多了解所有它的選項最好的方法是來看看一些範例。
或許您意外的刪除了一些檔案,不過您不確定您刪除了什麼,您可以試試下列的指令:
rpm -Va |
假如某些檔案遺失或似乎已毀損,您或許應該要重新安裝套件或解除安裝它,然後再重新安裝該套件。
在某些地方您也許會看到不曾見過的檔案,如要找出那一個套件擁有它,您可以輸入:
rpm -qf /usr/X11R6/bin/ghostview |
輸出將如下所示:
gv-3.5.8-22 |
我們可以結合以上兩個例子到下列的狀況下,譬如您的 /usr/bin/paste 檔案有問題,您想要確認擁有該程式的套件,不過您不知道那一個套件擁有 paste,只要輸入以下指令即可知道解答:
rpm -Vf /usr/bin/paste |
相關的套件將會被檢驗。
您想要找出關於一個特定程式的更多資訊嗎? 您可以試試下列指令來找出擁有該程式之套件所附的說明文件:
rpm -qdf /usr/bin/free |
輸出將如下所示:
/usr/share/doc/procps-2.0.11/BUGS /usr/share/doc/procps-2.0.11/NEWS /usr/share/doc/procps-2.0.11/TODO /usr/share/man/man1/free.1.gz /usr/share/man/man1/oldps.1.gz /usr/share/man/man1/pgrep.1.gz /usr/share/man/man1/pkill.1.gz /usr/share/man/man1/ps.1.gz /usr/share/man/man1/skill.1.gz /usr/share/man/man1/snice.1.gz /usr/share/man/man1/tload.1.gz /usr/share/man/man1/top.1.gz /usr/share/man/man1/uptime.1.gz /usr/share/man/man1/w.1.gz /usr/share/man/man1/watch.1.gz /usr/share/man/man5/sysctl.conf.5.gz /usr/share/man/man8/sysctl.8.gz /usr/share/man/man8/vmstat.8.gz |
您手上有一個新的 RPM,不過您不知道它的用處是什麼? 如要找出關於它的更多資訊,請使用下列指令:
rpm -qip crontabs-1.10-5.noarch.rpm |
輸出將如下所示:
Name : crontabs Relocations: (not relocateable) Version : 1.10 Vendor: Red Hat, Inc. Release : 5 Build Date: Fri 07 Feb 2003 04:07:32 PM EST Install date: (not installed) Build Host: porky.devel.redhat.com Group : System Environment/Base Source RPM: crontabs-1.10-5.src.rpm Size : 1004 License: Public Domain Signature : DSA/SHA1, Tue 11 Feb 2003 01:46:46 PM EST, Key ID fd372689897da07a Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : Root crontab files used to schedule the execution of programs. Description : The crontabs package contains root crontab files. Crontab is the program used to install, uninstall, or list the tables used to drive the cron daemon. The cron daemon checks the crontab files to see when particular commands are scheduled to be executed. If commands are scheduled, then it executes them. |
現在也許您想要知道 crontabs RPM 安裝了那些檔案,請您輸入以下指令:
rpm -qlp crontabs-1.10-5.noarch.rpm |
輸出將如下所示:
Name : crontabs Relocations: (not relocateable) Version : 1.10 Vendor: Red Hat, Inc. Release : 5 Build Date: Fri 07 Feb 2003 04:07:32 PM EST Install date: (not installed) Build Host: porky.devel.redhat.com Group : System Environment/Base Source RPM: crontabs-1.10-5.src.rpm Size : 1004 License: Public Domain Signature : DSA/SHA1, Tue 11 Feb 2003 01:46:46 PM EST, Key ID fd372689897da07a Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : Root crontab files used to schedule the execution of programs. Description : The crontabs package contains root crontab files. Crontab is the program used to install, uninstall, or list the tables used to drive the cron daemon. The cron daemon checks the crontab files to see when particular commands are scheduled to be executed. If commands are scheduled, then it executes them. |
這裡只是一些範例,當您開始使用它時,您將會漸漸發現 RPM 好用的地方。