RPM: Difference between revisions

From Leo's Notes
This page was last edited on 29 April 2013, at 15:57.
No edit summary
No edit summary
Line 1: Line 1:
To list installed packages:
=== List installed packages ===
<syntaxhighlight lang="bash" enclose="div">
  rpm -qa
  rpm -qa
</syntaxhighlight>


To look for a specific package by name:
=== Look for a specific package by name ===
<syntaxhighlight lang="bash" enclose="div">
  rpm -qi <package name>
  rpm -qi <package name>
</syntaxhighlight>


To determine the origin of a file:
=== Determine the origin of a file ===
<syntaxhighlight lang="bash" enclose="div">
  rpm -qf <path to file>
  rpm -qf <path to file>
</syntaxhighlight>


eg:
eg:
<syntaxhighlight lang="bash" enclose="div">
  # rpm -qf /etc/hosts
  # rpm -qf /etc/hosts
  setup-2.8.14-10.el6.noarch
  setup-2.8.14-10.el6.noarch
</syntaxhighlight>
=== Remove a package with a broken uninstall script ===
<syntaxhighlight lang="bash" enclose="div">
rpm -e --noscripts <package>
</syntaxhighlight>




Line 18: Line 31:


... it probably means that you ran <code>rpm</code>. To fix this warning, clear <code>yum</code>'s cache and force a rebuild by running:
... it probably means that you ran <code>rpm</code>. To fix this warning, clear <code>yum</code>'s cache and force a rebuild by running:
<syntaxhighlight lang="bash" enclose="div">
  yum clean all
  yum clean all
  yum makecache
  yum makecache
</syntaxhighlight>





Revision as of 15:57, 29 April 2013

List installed packages

 rpm -qa

Look for a specific package by name

 rpm -qi <package name>

Determine the origin of a file

 rpm -qf <path to file>

eg:

 # rpm -qf /etc/hosts
 setup-2.8.14-10.el6.noarch

Remove a package with a broken uninstall script

 rpm -e --noscripts <package>


Warning: RPMDB altered outside of yum.

If you ever get the error:

Warning: RPMDB altered outside of yum.

... it probably means that you ran rpm. To fix this warning, clear yum's cache and force a rebuild by running:

 yum clean all
 yum makecache