Freshening; Querying - Red Hat ENTERPRISE LINUX 4 System Administration Manual

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Chapter 15. Package Management with RPM

15.2.5. Freshening

Freshening a package is similar to upgrading one. Type the following command at a shell prompt:
rpm -Fvh foo-1.2-1.i386.rpm
RPM's freshen option checks the versions of the packages specified on the command line against the
versions of packages that have already been installed on your system. When a newer version of an
already-installed package is processed by RPM's freshen option, it is upgraded to the newer version.
However, RPM's freshen option does not install a package if no previously-installed package of the
same name exists. This differs from RPM's upgrade option, as an upgrade does install packages,
whether or not an older version of the package was already installed.
RPM's freshen option works for single packages or package groups. If you have just downloaded a
large number of different packages, and you only want to upgrade those packages that are already
installed on your system, freshening does the job. If you use freshening, you do not have to delete any
unwanted packages from the group that you downloaded before using RPM.
In this case, issue the following command:
rpm -Fvh *.rpm
RPM automatically upgrades only those packages that are already installed.

15.2.6. Querying

Use the rpm -q command to query the database of installed packages. The rpm -q foo command
displays the package name, version, and release number of the installed package foo:
foo-2.0-1
Note
To query a package, replace foo with the actual package name.
Instead of specifying the package name, use the following options with -q to specify the package(s)
you want to query. These are called Package Selection Options.
• -a queries all currently installed packages.
• -f <file> queries the package which owns <file>. When specifying a file, you must specify the
full path of the file (for example, /bin/ls).
• -p <packagefile> queries the package <packagefile>.
There are a number of ways to specify what information to display about queried packages. The
following options are used to select the type of information for which you are searching. These are
called Information Query Options.
• -i displays package information including name, description, release, size, build date, install date,
vendor, and other miscellaneous information.
136

Advertisement

Table of Contents
loading

Table of Contents