Rpm软件包管理工具的妙用妙用

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 的用途。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值