Using the Red Hat Package Manager (RPM) to Manage AWIPS Software
Gerry Murray
December 2003
This document describes how to use the Red Hat Package Manager
(RPM) to install, remove, verify and query packaged AWIPS software onto
a host that has the AWIPS base software already installed.
Preparing a Host for AWIPS RPM
Use
Installing the Software
Trouble Shooting an
Installation
Querying the RPM Database
Verifying the Integrity of Installed
Packages
Removing the Software
Limitations
RPM Resources
Preparing a Host for
AWIPS RPM Use
All RedHat systems come with a RPM relational database filled with
entries concerning each system package that came with the RedHat
distribution. This database is owned by the root account and one
needs to be root to install or remove packages using this database.
Installing any AWIPS package into this database as root could be
dangerous for several reasons; it would be possible to corrupt
both the system RPM database and the base AWIPS software, especially
the
localization data set. A better solution we are implementing here
is to have the fxa account use its own RPM database which will be
entirely independent from the system RPM database in
/var/lib/rpm. This database will initially be empty and
will require very little disk space.
The following two commands needs to be executed at least once by the
fxa user on
each Linux workstation that AWIPS packages will be installed on.
It
checks to see if a RPM database exists on the host and if not, it
creates a virgin RPM database into ~/rpmDB and creates a configuration
file that
tells all rpm commands to use this fxa owned database.
[ -d ~/rpmDB ] || (mkdir ~/rpmDB
&& rpm --initdb --dbpath
~/rpmDB)
[ -e ~/.rpmmacros ] || echo "%_dbpath
`echo $HOME`/rpmDB" >>!
~/.rpmmacros
Installing the
Software
- Download the AWIPS package file or several if you like since it
is very convenient to install several packages simultaneously. We
are using this file naming convention: <package name>-<package version>-<awips build>.rpm. The
awips build is the release that this package was built for and should
be installed on top of. (ob3, ob4, etc). If the package can
be installed on top of any awips release, the build will be "any".
- Select a Linux workstation host and log in as fxa.
- Bring the package file inside the firewall, put it in /tmp.
- If you want a description of what this package does or a list of
the package's file set, use a rpm command to query the package file as
described in the querying section.
- Install the package into the AWIPS base software
directory pointed to by $FXA_HOME. If successful, the
output will look similar to the following. If not, see the next
section for troubleshooting an installation.
rpm -Uvh --prefix
$FXA_HOME /tmp/qcmsBrowser-1.1-ob1.rpm
Preparing...
########################################### [100%]
1:qcmsBrowser
########################################### [100%]
This command can take several rpm files as arguments, thus wildcard
expansion is valid here as well. The "--prefix $FXA_HOME"
argument is essential; if
omitted, rpm will not flag an error but proceed to install the software
into /tmp/awips and the software will
not be usable.
- Once the package has been successfully installed, the package
file is no longer needed and can be deleted if desired.
All packages have a version associated with them but the version
numbering convention varies from package to package. The "-U"
switch tells
rpm to install the new version and then remove the old version and not
report an error if there is not an old version to remove. If you
would rather have RPM flag an error if an older version is already
installed, use the "-i" switch instead. RPM has
some intense logic to handle upgrading configuration files which are
package files that are allowed to be edited. If interested in
the details,
please see Maximum
RPM's discussion of this topic.
RPM has a nice feature where
files marked as documentation are excluded from the installation
by adding the '--excludedocs' switch to the install command.
Perhaps, this documentation doesn't need to be on every
workstation or even need to be on any workstation since it is
accessible
over the 'net. The choice is up to you.
You may be wondering why the '--prefix $FXA_HOME' is required
for every installation command. When building a package, the
packager has to specify the full pathname of each file or directory
belonging to the package. For most system packages, this isn't a
problem since the files should always be installed in the same
locations like /usr/bin, /etc. However, AWIPS software always
goes in the $FXA_HOME
directory and the rub is that $FXA_HOME
can be set to different values on different systems. Thus, all AWIPS
packages are designed as relocatable. The final location of the
package's files are decided at install time and the --prefix switch is
how we specify that final location.
Trouble Shooting an
Installation.
Most common problem by far is a failed dependency. Some AWIPS
packages require files from other packages to be installed in order for
the software to run correctly. For example, the application
launcher software is developed for Tcl/Tk 8.4 but many sites don't have
Tcl/Tk 8.4 installed yet. To work around the problem, the Tcl/Tk
8.4 run-time environment (RTE) was packaged and is listed as a
dependency for the application launcher package. Here's what
happens when we try to install the application launcher without the
Tcl/TK RTE.
rpm -Uvh --prefix
$FXA_HOME appLauncher-7-any.rpm
error: failed dependencies:
tcltk84_RTE is needed by appLauncher-7-ob4
To fix this, find and install the required package and then install the
first package again. Or install the original package and its
required packages together with the same rpm command.
rpm -Uvh --prefix
$FXA_HOME appLauncher-7-any.rpm tcltk84_RTE-3-any.rpm
Preparing...
########################################### [100%]
1:tcltk84_RTE
########################################### [ 50%]
2:appLauncher
########################################### [100%]
An AWIPS package can contain
executables that are built especially for a particular AWIPS release.
If you try to install a package built for a different
release than the one installed on the workstation, rpm will complain
with the following message and fail to install. Of course, if the
release is "any",
then this check will never be performed.
rpm -Uvh --prefix $FXA_HOME
/tmp/qcmsBrowser-1.1-ob1.rpm
Preparing...
########################################### [100%]
Aborting... Can't install on a
system that's not ob1
error: %pre(qcmsBrowser-1.1-ob2)
scriptlet failed, exit status 1
error: install: %pre
scriptlet failed (2), skipping qcmsBrowser-1.1-ob2
If you try to install a package that is already installed, RPM
will not install it by default and will display this message
instead. However if there is a problem with the currently
installed package,
this check can be disabled by adding the --replacepkgs switch to the
install command.
rpm -Uvh --prefix $FXA_HOME
/tmp/qcmsBrowser-1.1-ob1.rpm
Preparing...
########################################### [100%]
package
qcmsBrowser-1.1-ob1 is already installed
rpm -Uvh --prefix $FXA_HOME
--replacepkgs /tmp/qcmsBrowser-1.1-ob1.rpm
Preparing...
########################################### [100%]
1:qcmsBrowser
########################################### [100%]
RPM allows you to easily upgrade to a later version of a package but
does not allow you to "upgrade" to an earlier version of the
package. There is ways to override this check, but probably the
best thing to do is to remove the later version and install the earlier
version.
rpm -Uvh
--prefix $FXA_HOME
tcltk84_RTE-2-any.i386.rpm
Preparing...
########################################### [100%]
package tcltk84_RTE-3-ob4 (which
is newer than tcltk84_RTE-2-any) is already installed
rpm -e
tcltk84_RTE
rpm -Uvh
--prefix $FXA_HOME
tcltk84_RTE-2-any.i386.rpm
Preparing...
########################################### [100%]
1:tcltk84_RTE
########################################### [100%]
Querying the RPM Database
The most fundamental question that RPM answers is which packages are
currently installed on a host. RPM supports classification of
packages into groups defined by the packager. Applications like
the application launcher or the QCMS Browser have been classified into
a group called "AWIPS/Applications" while the Tcl/Tk 8.4 run time
environment package fits more into the "AWIPS/COTS"
category. In the future, there
may be other groups like AWIPS/Decoders, AWIPS/Extensions, etc...
To get a list of all installed packages that belong to a certain
group, issue
commands like these on any of the hosts where you built an RPM
database.
This will display the package name, version, and the supported
AWIPS build of the packages that are in the specified group. To
list all the packages installed in the fxa RPM database, use the "rpm
-qa" command.
rpm -qg
AWIPS/Applications
qcmsBrowser-1.1-ob1
appLauncher-7-any
rpm
-qg AWIPS/COTS
tcltk84_RTE-3-any
rpm -qg AWIPS/Decoders
group AWIPS/Decoders does not contain any packages.
rpm -qa
qcmsBrowser-1.1-ob1
appLauncher-7-any
tcltk84_RTE-3-any
Every package has a very detailed header containing some useful
information such as a detailed description of what the package does,
installation date, the URL of this documentation, as well as some
not so useful trivia like the host where the package was built, the
copyright information and this package's associated source code package
name. For example:
rpm -qi qcmsBrowser
Name
:
qcmsBrowser
Relocations: /tmp/awips
Version :
1.1
Vendor: NOAA/AWIPS
Release :
ob1
Build Date: Mon 20 Oct 2003 11:55:53 PM GMT
Install date: Tue 21 Oct 2003
04:52:48 PM GMT Build Host:
apollo.fsl.noaa.gov
Group
:
AWIPS/Applications
Source RPM: qcmsBrowser-1.1-ob1.src.rpm
Size
:
6966335
License: Public Domain
Packager :
Gerry Murray, gerry.murray@noaa.gov
URL
: http://www-sdd.fsl.noaa.gov/MSAS/qcms/relNotes.html
Summary :
Application for selecting and viewing QCMS data on ob1 workstations.
Description :
The QCMS Browser is the
user interface/display component of the
Quality Control and
Monitoring System. This application is
integrated into the D2D
component of AWIPS, providing interfaces to
view and modify quality
control data on station observations from
various providers.
The user can select subsets of this data for
display on D2D as plan view
and time series plots or see the same
data in tabular form on the
user interface. This release is meant to
be a prototype for
soliciting feedback and only demonstrates the
editing and subjective
intervention mechanisms but does not actually
change any data. A later
operational release will channel the user's
modifications back into the
QCMS processing.
Installing this package
will customize the localization, adding and
altering some key files to
the localization data set for the local
site. Removing this
package will restore the localization and remove
any QCMS customizations.
This package can only be
installed on top of AWIPS Build ob1
The RPM database also records extensive data about every file and
directory that makes up the package; this can be obtained with the rpm -qlv command. For
example, querying the contents of the browser package yields an output
similar in format to "ls -l".
Here is a small sampling of that output:
rpm -qlv qcmsBrowser
-rwxrwxr-x 1
fxa
fxalpha 2561 Oct
20 23:55 /awips/fxa/bin/buildProvID2Name
-rwxrwxr-x 1
fxa
fxalpha 1081 Oct
20 23:55 /awips/fxa/bin/findQCMSFile
-rwxrwxr-x 1
fxa
fxalpha 3467 Oct
20 23:55 /awips/fxa/bin/initQCMSDataDirs
-rwxrwxr-x 1
fxa
fxalpha 12066 Oct 20
23:55 /awips/fxa/bin/localizeQCMS
-rwxrwxr-x 1
fxa
fxalpha 50315 Oct 20
23:55 /awips/fxa/bin/qcmsBrowser
-rwxrwxr-x 1
fxa
fxalpha
92 Oct 20 23:55 /awips/fxa/bin/qcmsSelector
-rwxrwxr-x 1
fxa fxalpha
2593925 Oct 20 23:55 /awips/fxa/bin/qcmsSelectorWish
-rwxrwxr-x 1
fxa fxalpha
1007159 Oct 20 23:55 /awips/fxa/bin/qcmsSummaryDecoder
-rwxrwxr-x 1
fxa fxalpha
2600592 Oct 20 23:55 /awips/fxa/bin/qcmsWish
-rwxrwxr-x 1
fxa
fxalpha 2245 Oct
20 23:55 /awips/fxa/bin/stripColumn
drwxrwxr-x 2
fxa
fxalpha
0 Oct 20 23:55 /awips/fxa/data/QCMS
-rw-rw-r-- 1
fxa
fxalpha
89 Oct 20 23:55 /awips/fxa/data/QCMS/QCMS.spi
-rw-rw-r-- 1
fxa
fxalpha
27 Oct 20 23:55 /awips/fxa/data/QCMS/QC_fail_lookup.txt
-rw-rw-r-- 1
fxa
fxalpha
43 Oct 20 23:55 /awips/fxa/data/QCMS/activeGridSources.txt
drwxrwxr-x 2
fxa
fxalpha
0 Oct 20 23:55 /awips/fxa/data/QCMS/bitmaps
-rw-rw-r-- 1
fxa
fxalpha 248
Oct 20 23:55 /awips/fxa/data/QCMS/bitmaps/downArrow.xbm
-rw-rw-r-- 1
fxa
fxalpha 242
Oct 20 23:55 /awips/fxa/data/QCMS/bitmaps/upArrow.xbm
-rw-rw-r-- 1
fxa
fxalpha 3312 Oct
20 23:55 /awips/fxa/data/QCMS/dataFieldTable.txt
-rw-rw-r-- 1
fxa
fxalpha 2596 Oct
20 23:55 /awips/fxa/data/QCMS/fileLocations.txt
-rw-rw-r-- 1
fxa
fxalpha 278
Oct 20 23:55 /awips/fxa/data/QCMS/graphStyle.rules
-rw-rw-r-- 1
fxa
fxalpha 143
Oct 20 23:55 /awips/fxa/data/QCMS/iconStyle.rules
-rw-rw-r-- 1
fxa
fxalpha
0 Oct 20 23:55 /awips/fxa/data/QCMS/ldad15QCMS.spi
-rw-rw-r-- 1
fxa
fxalpha
52 Oct 20 23:55 /awips/fxa/data/QCMS/localAppInfo.txt
-rw-rw-r-- 1
fxa
fxalpha 2311 Oct
20 23:55 /awips/fxa/data/QCMS/localDataKeys.txt
...
It is also possible to query which files are classified as
documentation by adding a 'd' to the previous command. RPM also
allows the packager to specify files as configuration files that may be
modified by the user or site manager while the package is installed.
These files will be handled with special care upon package
removal
and update. To query config files, add a 'c' to the file query
command. Here's a list of the documentation and config files that
make up the browser.
rpm -qlvd
qcmsBrowser
-rw-rw-r-- 1
fxa
fxalpha 26524 Oct 20
23:55 /awips/fxa/doc/QCMS/browserInitial.jpg
-rw-rw-r-- 1
fxa
fxalpha 12455 Oct 20
23:55 /awips/fxa/doc/QCMS/displayStation.png
-rw-rw-r-- 1
fxa
fxalpha 5906 Oct
20 23:55 /awips/fxa/doc/QCMS/editObs.jpg
-rw-rw-r-- 1
fxa
fxalpha 16495 Oct 20
23:55 /awips/fxa/doc/QCMS/hourlyPlanView.png
-rw-rw-r-- 1
fxa
fxalpha 45068 Oct 20
23:55 /awips/fxa/doc/QCMS/hourlyTable.jpg
-rw-rw-r-- 1
fxa
fxalpha 5318 Oct
20 23:55 /awips/fxa/doc/QCMS/hourlyTimeSeriesFields.jpg
-rw-rw-r-- 1
fxa
fxalpha 13694 Oct 20
23:55 /awips/fxa/doc/QCMS/igcTimeSeries.png
-rw-rw-r-- 1
fxa
fxalpha 6352 Oct
20 23:55 /awips/fxa/doc/QCMS/missingStation.jpg
-rw-rw-r-- 1
fxa
fxalpha 4499 Oct
20 23:55 /awips/fxa/doc/QCMS/noData.jpg
-rw-rw-r-- 1
fxa
fxalpha 38311 Oct 20
23:55 /awips/fxa/doc/QCMS/optionMenu.jpg
-rw-rw-r-- 1
fxa
fxalpha 6554 Oct
20 23:55 /awips/fxa/doc/QCMS/queryThreshold.jpg
-rw-rw-r-- 1
fxa
fxalpha 122669 Oct 20 23:55
/awips/fxa/doc/QCMS/relNotes.html
-rw-rw-r-- 1
fxa
fxalpha 58560 Oct 20
23:55 /awips/fxa/doc/QCMS/rpmInstall.html
-rw-rw-r-- 1
fxa
fxalpha 8670 Oct
20 23:55 /awips/fxa/doc/QCMS/selectedStationFrame.jpg
-rw-rw-r-- 1
fxa
fxalpha 6470 Oct
20 23:55 /awips/fxa/doc/QCMS/singleChoiceDlg.jpg
-rw-rw-r-- 1
fxa
fxalpha 25830 Oct 20
23:55 /awips/fxa/doc/QCMS/summaryPlanView.png
-rw-rw-r-- 1
fxa
fxalpha 46841 Oct 20
23:55 /awips/fxa/doc/QCMS/summaryTable.jpg
-rw-rw-r-- 1
fxa
fxalpha 8466 Oct
20 23:55 /awips/fxa/doc/QCMS/summaryTimeSeriesFields.jpg
rpm -qlvc qcmsBrowser
-rw-rw-r-- 1
fxa
fxalpha 2596 Oct
20 23:55 /awips/fxa/data/QCMS/fileLocations.txt
-rw-rw-r-- 1
fxa
fxalpha 3655 Oct
20 23:55 /awips/fxa/data/QCMS/qcmsBrowserObs.txt
-rw-rw-r-- 1
fxa
fxalpha 4393 Oct
20 23:55 /awips/fxa/data/QCMS/sfchqcin.dat
RPM supports the inverse kind of inquiry as well. Suppose you
come across some file or directory that is not familiar and you want to
find out which package it belongs to. Here is an example:
rpm
-qf /awips/fxa/bin/stripColumn
qcmsBrowser-1.1-ob1
So far we covered
obtaining information only about packages that are installed on a host,
but it also possible to use RPM to dump information about package files
that haven't been installed yet. In fact, both the -qi and -qlv
queries described above work on package files as well; just add the -p
switch and specify the full pathname of the package file. Like so:
rpm -qip
/tmp/qcmsBrowser-ob2.rpm
Name
:
qcmsBrowser
Relocations: /tmp/awips
Version :
1.1
Vendor: NOAA/AWIPS
Release :
ob2
Build Date: Tue 21 Oct 2003 12:04:42 AM GMT
Install date: (not
installed)
Build Host: apollo.fsl.noaa.gov
Group
:
AWIPS/Applications
Source RPM: qcmsBrowser-1.1-ob2.src.rpm
Size
:
6966367
License: Public Domain
Packager :
Gerry Murray, gerry.murray@noaa.gov
URL
: http://www-sdd.fsl.noaa.gov/MSAS/qcms/relNotes.html
Summary :
Application for selecting and viewing QCMS data on ob2 workstations.
Description :
The QCMS Browser is the
user interface/display component of the
Quality Control and
Monitoring System. This application is
integrated into the D2D
component of AWIPS, providing interfaces to
view and modify quality
control data on station observations from
various providers.
The user can select subsets of this data for
display on D2D as plan view
and time series plots or see the same
data in tabular form on the
user interface. This release is meant to
be a prototype for
soliciting feedback and only demonstrates the
editing and subjective
intervention mechanisms but does not actually
change any data. A later
operational release will channel the user's
modifications back into the
QCMS processing.
Installing this package
will customize the localization, adding and
altering some key files to
the localization data set for the local
site. Removing this
package will restore the localization and remove
any QCMS customizations.
This package can only be
installed on top of AWIPS Build ob2
rpm -qlvp
/tmp/qcmsBrowser-ob2.rpm
...
-rw-rw-r-- 1
fxa
fxalpha 6554 Oct
21 00:04 /tmp/awips/doc/QCMS/queryThreshold.jpg
-rw-rw-r-- 1
fxa
fxalpha 122669 Oct 21 00:04
/tmp/awips/doc/QCMS/relNotes.html
-rw-rw-r-- 1
fxa
fxalpha 58560 Oct 21
00:04 /tmp/awips/doc/QCMS/rpmInstall.html
-rw-rw-r-- 1
fxa
fxalpha 8670 Oct
21 00:04 /tmp/awips/doc/QCMS/selectedStationFrame.jpg
-rw-rw-r-- 1
fxa
fxalpha 6470 Oct
21 00:04 /tmp/awips/doc/QCMS/singleChoiceDlg.jpg
-rw-rw-r-- 1
fxa
fxalpha 25830 Oct 21
00:04 /tmp/awips/doc/QCMS/summaryPlanView.png
-rw-rw-r-- 1
fxa
fxalpha 46841 Oct 21
00:04 /tmp/awips/doc/QCMS/summaryTable.jpg
-rw-rw-r-- 1
fxa
fxalpha 8466 Oct
21 00:04 /tmp/awips/doc/QCMS/summaryTimeSeriesFields.jpg
drwxrwxr-x 2
fxa
fxalpha
0 Oct 21 00:04 /tmp/awips/lib/tcl/QCMS
-rw-rw-r-- 1
fxa
fxalpha 20922 Oct 21
00:04 /tmp/awips/lib/tcl/QCMS/metaDataMgr.tcl
-rw-rw-r-- 1
fxa
fxalpha 2388 Oct
21 00:04 /tmp/awips/lib/tcl/QCMS/namespaceUtils.tcl
-rw-rw-r-- 1
fxa
fxalpha 7581 Oct
21 00:04 /tmp/awips/lib/tcl/QCMS/optionMenuWidget.tcl
-rw-rw-r-- 1
fxa
fxalpha 959
Oct 21 00:04 /tmp/awips/lib/tcl/QCMS/pkgIndex.tcl
-rw-rw-r-- 1
fxa
fxalpha 20371 Oct 21
00:04 /tmp/awips/lib/tcl/QCMS/queryDialogs.tcl
-rw-rw-r-- 1
fxa
fxalpha 3350 Oct
21 00:04 /tmp/awips/lib/tcl/QCMS/random.tcl
-rw-rw-r-- 1
fxa
fxalpha 32475 Oct 21
00:04 /tmp/awips/lib/tcl/QCMS/tableWidget.tcl
You might notice that the pathnames are slightly different than when we
queried the files belonging to the installed package.
As we explained earlier,
upon installation RPM performs a relocation which will install the
files
under the $FXA_HOME
directory.
Verifying the Integrity of
Installed Packages
Since Murphy's Law (or Murray's Law, as it applies to me) elegantly
states that if there is anything that can go wrong, it probably will;
it's nice to know that RPM has some safety mechanisms capable of
detecting when installed packages have been compromised in some subtle
way. This is relatively easy for RPM since its database has data
about almost every significant file and directory attribute for every
installed package. In addition to installed file attribute
checking, a script is invoked that verifies that the QCMS
customizations
are still correctly installed into the workstation's primary site
localization. To verify an installed package, use the command:
rpm -Vv
<installed package name>
While checking its installed contents, RPM produces output only if one
of the package's directories or files has been altered in some way.
When
a file fails verification, the format of the output is a bit
cryptic, but it packs all the information you need into one
line per file. Here is the format:
SM5DLUGT c <file>
-
S is the file size.
-
M is the file's mode
(permissions)
-
5 is the MD5 checksum which
indicates whether the contents of the file has changed, even if by only
one byte.
-
D is the file's major and
minor
numbers.
-
L is the file's symbolic link
contents.
-
U is owner of the file.
-
G is the file's group.
-
T is the modification time of
the file.
- c appears only if the file is a
configuration file. This is handy for quickly identifying config
files, as they are very likely to change, and therefore very unlikely to verify successfully.
-
<file>
is the file that failed verification. The complete path is listed to
make it easy to find.
It's unlikely that every file attribute will
fail to verify, so each of the eight attribute flags will only appear
if
there is a problem. Otherwise, a "."
will be printed in that flag's place. RPM will also notice if
one
of the package's files or directories is missing entirely. Here's
a plausible example of a site user, logged in as some user besides fxa,
edited the config file: $FXA_HOME/data/QCMS/fileLocations.txt,
and then inadvertently deleted the $FXA_HOME/data/QCMS/bitmaps directory.
# Before Editing ...
ll
$FXA_HOME/data/QCMS/fileLocations.txt
-rw-rw-r-- 1
fxa fxalpha
2596 Oct 20 23:55 /awips/fxa/data/QCMS/fileLocations.txt
# After
Editing ...
ll
$FXA_HOME/data/QCMS/fileLocations.txt
-rw-rw-r-- 1
murray fxalpha 2584 Oct 21
18:32 /awips/fxa/data/QCMS/fileLocations.txt
rm -rf
$FXA_HOME/data/QCMS/bitmaps
rpm -Vv
qcmsBrowser
missing
/awips/fxa/data/QCMS/bitmaps
missing
/awips/fxa/data/QCMS/bitmaps/downArrow.xbm
missing
/awips/fxa/data/QCMS/bitmaps/upArrow.xbm
S.5..U.T c
/awips/fxa/data/QCMS/fileLocations.txt
Successfully verified BOU
localization for QCMS browser operation.
In addition to detecting that the bitmaps directory and its associated
files were deleted, RPM also detected that the contents, the size, the
modification time and the owner has changed for fileLocations.txt which can be
clearly seen by examining the before and after directory listing.
Some AWIPS packages perform some extensive configuration such as
running a localization upon installing the package. The package
could have some logic that checks to see if those configurations are
still valid. This extra verification check is done in addition to
RPM's file integrity checks.
Removing the
Software.
If package technology is to be useful to AWIPS, the ability to cleanly
remove packaged software without a trace that it was ever installed is
absolutely essential. For some packages, if there was any special
configuration done to the base AWIPS tree upon installation, this needs
to be reversed completely. If this restoration succeeds, RPM will
then remove the directories and files associated
with the package and then update its database.
Potentially, not all of the files or directories are deleted however.
Think back to our verification example when a user modified the
config file, fileLocations.txt. If
the edits were elaborate, it would be very disconcerting if the changes
were lost once the qcmsBrowser package was removed. No worries
with RPM since this file and two other browser files are flagged as
configuration files. RPM will rename modified config files to <name>.rpmsave and will
not delete the directory the saved files belong to. If RPM
detects
that the config files have not changed, using a MD5 checksum algorithm,
the files will be deleted without making a copy first.
Use the "rpm -e" command to remove one or more installed
packages. Here's an example of when RPM leaves a modified
configuration file behind.
rpm -e qcmsBrowser
Now running the localization! This
will take a few minutes...
Successfully restored FSL
localization to its original state
warning:
/awips/fxa/data/QCMS/fileLocations.txt saved as
/awips/fxa/data/QCMS/fileLocations.txt.rpmsave
Keep in mind that RPM will not remove a package if some other installed
package
depends on it. To use our example earlier with the application
launcher, if we try to remove the Tcl/TK Run Time Environment while the
launcher package is still installed, rpm will complain:
rpm -e tcltk84_RTE
error: removing these packages
would break dependencies:
tcltk84_RTE is needed by appLauncher-7-ob4
Either remove the dependent and required packages together with the
same "rpm -e" command or remove the dependent package first
(appLauncher) and then the required package (tcltk84_RTE)
Limitations
The database is owned by the fxa account which means that package
installation and removal can only be done by fxa. However, querying and
verification can be performed by any account. Remember, we
installed the file .rpmmacros
in the home directory of the fxa account which tells RPM where the
AWIPS
database is located. Other accounts can install the same file in
their home directories or include the argument "--dbpath $FXA_HOME/RPM/DB" with
each rpm verify or query command.
RPM Resources
Hopefully, these packages and document will whet your appetite and
inspire you to learn more about the RedHat Package Manager.
Here's
a few links to get you started..
- Good place to start is the man page for rpm .
Fairly
well written for man page standards.
- RPM
HOWTO Written by Donnie Barnes from RedHat. Good
Overview.
- www.rpm.org The RPM
website. Good place to find other RPM related links and mailing
lists.
- Maximum RPM Written
by Edward C. Bailey. The authoritative RPM resource!
- RPM
White Paper Written by some bozo describing the advantages of using
RPM to manage AWIPS software.
- RPM
for AWIPS Grid Changes Another use for RPM in an AWIPS environment;
applying and removing configuration changes to grid sources.