RPM is a powerful and mature command-line driven package management system capable of installing, uninstalling, verifying, querying, and updating Unix software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like. There is also a library API, permitting advanced developers to manage such transactions from programming languages such as C, Perl or Python.
Traditionally, RPM is a core component of many Linux distributions, including Red Hat Enterprise Linux, Fedora, Novell SUSE Linux Enterprise, openSUSE, CentOS, Mandriva Linux, and many others. But RPM is also used for software packaging on many other Unix operating systems like FreeBSD, Sun OpenSolaris, IBM AIX and Apple Mac OS X through the cross-platform Unix software distribution OpenPKG. Additionally, the RPM archive format is an official part of the Linux Standard Base (LSB).
RPM was originally written in 1997 by Erik Troan and Marc Ewing for use in the Red Hat Linux distribution. Later the development of RPM became a classical free software community effort, now lead since many years by RPM's primary developer Jeff Johnson. RPM is released as free software under the GNU LGPL distribution license.

Working with the rpm command

The rpm command performs the most common package-management functions, along with a host of uncommon functions as well. The table below lists the main operations you can perform with the rpm command and the command-line options to specify the given operations.

Operation Short Option Long Option
Upgrade/install -U --upgrade
Install -I --install
Remove -e --erase
Query -q --query
Verify -V --verify
Check signature -K --checksig
Freshen (upgrade) already-installed package -F --freshen
Initialize database None --initdb
Rebuild database None --rebuilddb

1. Compression of packages
2. SHA-256 hashes are used to sign packages
3. RPM DB: '?var/lib/rpm' - tracks installed packages, attributes of pacage files, etc.
4. 5-Modes of operation
a. Install
b. Uninstall
c. Upgrade
d. Query
e. Verify
5. Caveat: Does NOT auto-resolve dependencies: Use 'yum'
6. Caveat: RPM does not track non RPM programs

1. Query
a. 'rpm -qa' - dumps all installed packages
b. 'rpm -qi grep' - queries the complete information of the package
c. 'rpm -ql grep' - enumerates the contents of the package 'grep'
d. 'rpm -qf /bin/grep' - enumerates the file's package membership
e. 'rpm -qd grep' - enumerates the included documentation
f. 'rpm -qc grep' - enumerates the package's configuration file(s)
g. 'rpm -qpi unix2dos-2.2-35.el6.i686.rpm'

2. Verify - verifies file systems contents against installed package in RPM DB
Note: Returns: '.' per test performed if the test passed
Note: If test fails one of the following will be returned
5(MD5), S(file Size), L(Symlink), T(mod time), D(device), M(mode), ?(unreadable file), U(user), G(group)
a. 'rpm -Vvf /bin/grep' - compares: /bin/grep to 'grep' RPM
b. 'mv /bin/grep /bin/grep.original&& touch /bin/grep' - SM5....T.
3. Install
a. 'rpm -ivh unix2dox-3.1-37.el6.i686.rpm'

4. Upgrade - Installs and/or upgrades
a. 'rpm -Uvh dos2unix-3.1-37.el6.i686.rpm'
b. 'rpm -Uvh --replacepkgs grep-2.6.3-2.el6.i686.rpm'

5. Uninstall
a. 'rpm -e grep' - checks dependencies and warns where appropriate

6. Import RedHat RPM GPG Key to confirm package signatures:
a. 'rpm --import'

No comments:

Post a Comment