Tuesday, October 23, 2007

Useful RPM options

rpm, search for this in Wikipedia and you'll get some gr8 info about revolutions per minute. But as we all know this tool and have been using this for quiet some time now on Linux distros...
Here's what www.rpm.org has to say about RPM:
The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer 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 or Python.

With that bit of knowledge about RPM let me assure you that even a non-programmer would be doing a lot on his Linux machine that needs him to know basic rpm usage.
Like: 1) rpm -ivh for installing a new RPM pkg
2) rpm -Uvh for upgrading an existing rpm pkg
3) rpm -e for un-installing an rpm
4) rpm -Uvh --test To test a package to see how it would install (w/o installing, also checks dependencies)

Now, there's a hell lot of information on how to do things with RPM at:
Maximum RPM
Just so that I can remember some useful but difficult-to-find-when-you-need'em options, I've tried to put up a collection here:

RPM Querying: Get Info from installed Packages

To see a list of all installed packages: rpm -qa | less

Don't know what a specific installed package does? Hey, tell me about yourself:
rpm -qi
To know what files were installed by a specific installed package: rpm -ql
A similar thing is also achievable by: rpm -q --filesbypkg
To know the config files in an installed package: rpm -qc
There's a file on my comp /usr/lib/foo-lib. To find out which installed package it belongs to: rpm -qf /usr/lib/foo-lib
To find out which package installed the above file AND to get information on that package and see all the other files it installed: rpm -qilf /usr/lib/foo-lib
The scripts in a package: rpm -q --scripts
Services that this package provides: rpm -q --provides
Services that this package requires: rpm -q --requires

For pkg that has NOT been installed yet, we can query for similar information by adding the -p option to the commands listed above.
Get information about an RPM pkg (not yet installed) and the files it would install: rpm -qilp

Verify options:
To verify a package (with lots of verbose output): rpm -Vvv
To verify the cryptographic signature of a yet-to-be-installed package:
rpm -K
And to test the integrity of a yet-to-be-installed pkg: rpm -K --nopgp package.rpm
To verify ALL installed packages on the comp: rpm -Va
Imp Tip: The above command is also useful in the following scenarios:
1) You deleted some files accidently but you don't know what they are. The above rpm command can show you the files that are now missing in its database.
2) Think you've been hacked? To check for files that have been modified or removed in any way for any installed RPM packages.

To extract an individual file from an rpm package without installing the rpm:
1. Use rpm2cpio or rpm -qpl to list files and full paths in the package:
rpm2cpio package | cpio -t
Now, use the full path name of a file listed above to extract it in step 2.
2. Use rpm2cpio to extract a file. Run this command from your home directory or /tmp in order to avoid overwriting any current system files.
rpm2cpio package | cpio -iv --make-directories
This creates the full path in the current directory and extracts the file you specified.
3. If you just want to convert it to a cpio archive, use
rpm2cpio package > cpio-archive-file

To extract all the files from an RPM package:
rpm2cpio package | cpio -i --make-directories

Although there are a lot of other useful options, I'll have these most useful ones for now on this page.
Some imp links for rpm options:
http://dave.thehorners.com/content/view/111/65/
http://susefaq.sourceforge.net/articles/rpm.html

I would be interested to know some scenarios where we use a complex set of options to determine more practical information on rpm installs.
Also one good link (place holder for me) about un-installing a gnu-source compiled program:
http://blog.netotto.com/index.php?entry=entry071020-232245

5 comments:

Anonymous said...

Good post and this post helped me alot in my college assignement. Say thank you you on your information.

Kishore said...

Gr8 that it helped you... thanks for visiting the blog and leaving a thank you note!

Anonymous said...

Wettervorhersage is a set of all the phenomena occurring in a given atmosphere at a given time. Most weather phenomena occur in the troposphere, just below the stratosphere. the weather refers, generally, to day-to-day temperature and precipitation activity, whereas climate is the term for the average atmospheric conditions over longer periods of time. When used without qualification, "weather" is understood to be the weather of Earth.

Anonymous said...

Hey.

A banks is a financial institution that accepts deposits and channels those deposits into lending activities. Banks primarily provide financial services to customers while enriching investors. Government restrictions on financial activities by bank vary over time and location. Banks are important players in financial markets and offer services such as investment funds and loans. In some countries such as Germany, bank have historically owned major stakes in industrial corporations while in other countries such as the United States banks are prohibited from owning non-financial companies. In Japan, banks are usually the nexus of a cross-share holding entity known as the keiretsu. In France, bancassurance is prevalent, as most banks offer insurance services (and now real estate services) to their clients.

The level of government regulation of the banking industry varies widely, with countries such as Iceland, having relatively light regulation of the banking sector, and countries such as China having a wide variety of regulations but no systematic process that can be followed typical of a communist system.[url=http://projectcontrol.v3host.nl]CLICK HERE[/url]

Anonymous said...

Madeline, are you sure :)

Margo
http://dna-insurance.info