Freshening; Querying - Red Hat ENTERPRISE LINUX 5 - DEPLOYMENT Deployment Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - DEPLOYMENT:
Table of Contents

Advertisement

Chapter 10. Package Management with RPM
To force RPM to upgrade anyway, use the --oldpackage option:
rpm -Uvh --oldpackage foo-1.0-1.i386.rpm

10.2.5. Freshening

Freshening is similar to upgrading, except that only existent packages are upgraded. 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.
Freshening 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. Thus, 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.

10.2.6. Querying

The RPM database stores information about all RPM packages installed in your system. It is stored in
the directory /var/lib/rpm/, and is used to query what packages are installed, what versions each
package is, and any changes to any files in the package since installation, among others.
To query this database, use the -q option. The rpm -q package name command displays the
package name, version, and release number of the installed package package name. For example,
using rpm -q foo to query installed package foo might generate the following output:
foo-2.0-1
You can also use the following Package Selection Options with -q to further refine or qualify your
query:
• -a — queries all currently installed packages.
• -f <filename> — queries the RPM database for which package owns f<filename>. When
specifying a file, specify the absolute path of the file (for example, rpm -qf /bin/ls).
• -p <packagefile> — queries the uninstalled package <packagefile>.
126

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 5 - DEPLOYMENT and is the answer not in the manual?

Questions and answers

Table of Contents