rpm
introduction
rpm is a an executable which allows for package manipulation; everything on redhat is rpm now, they don't have any tarballs. Actually, this is a good idea, it's like the "uninstall wizard" on MS machines. In other words, it's a workign record of all the things you have done to your machine, from day 0. If you wonder where a certain file came from just query using "the rpm wizard" and you can then find what to uninstall, change, etc.
If a application needs to be installed from tarball instead of from rpm, uninstall the old rpms before you install a tarball. I then install the tarballs always into /usr/local to compensate for lack of rpm's centralized database control.
if you have the problem "cannot open database in db3 format" make sure CRON daemon is not running, as this will perfomr the lock. I think if the error number is (13) it's because your'e not root and you should be, and if it's (1) then it 's the cron thing.
basics
| installing packages |
| rpm -Va | tells which files are missing or corrupted |
| rpm -ivh something.rpm | installing a package if the rpm is something.src.rpm go then to /usr/src/redhat/SOURCES/ and there will be the unpackaged files |
| rpm -ivh --replacepkgs something.rpm | to overwrite |
| rpm -Uvh something.rpm | to overwrite and replace packages |
| uninstalling packages |
| rpm -e foo | uninstalling a package |
| querying and package management |
| rpm -qdf /usr/bin/ispell | prints out all DOCUMENTATION which was installed along with the rest of the package |
| rpm -qlf /usr/bin/ispell | prints out all files which belong to the package |
| rpm -q | queeries the package name, version and release version |
| rpm -qf /usr/bin/gawk | responds with the package that gawk belongs to |
| rpm -i | displays package name, version, and description; in other words, the description of the package as prepared by the maintenars |
| rpm -qif /usr/bin/gawk | responds with the package that gawk belongs to |
| rpm -qpi something.1.2-3.rpm | responds with the long description |
| rpm -qp[fi] actually_existing_rpm_file_name.rpm | does the qeurying against the file there on your hard drive |
rpm -qa | grep -i gcc rpm -qi gcc-2.96-81 | |
| rpm -qf rpm | file rpm: No such file or directory |
| rpm -qf /sbin/ifup | initscripts-5.49-1 (responds with package owning that file; requires absolute path) |
| rpm -q --whatrequires /sbin/ifup | responds with no package requires /sbin/ifup |
| rpm -ql | lists piles in a package |
| rpm -ql `rpm -qa | grep dhcpcd` | prints out all files in the rpm package whose name contains 'dhcpcd' |
| rpm -ql | rpm -qa | grep "apache" | prints out the name of the
installed package which contains the words "apache" |
| verification |
| rpm -Vrpm | In case there is a discrepancy in the 'verification', responds in a line with 5.L T c path/file-name- L: symbolic link
- T: file modification time
|
| rpm -Vf /bin/vi | verifies that the file /bin/vi exists on the system, comes from a package, and is THE SAME as when first installed |
| rpm -Vp foo-1.10.1.i386.rpm | verifies that both the file you just downloaded and the one installed are the same |
return to top