Pick a Free OS

User login


RPM usage for newbies

e.g - rpm -e gpm would remove the package named gpm

Occasionally you might get dependency errors when removing packages that

are required by other packages. Use --nodeps here too tell rpm to ignore

such dependency errors and uninstall the package regardless.


Query is one useful function that you really need to know. Generally a

query is given with the -q followed by a query option.

If you want to check out the version of the installed package then simply

run a '-q' on the package.

rpm -q samba

- samba-2.0.6-62

-f = You see a file on your drive and you want to know what package it

comes in then use

rpm -qf /usr/sbin/smbd


-i = Information regarding a package installed on your system.

rpm -qi samba

- Information regarding here. Description, version and packager

and other miscellaneous information.

-l = Long listing of the files in a package installed in your system. Shows

you the full paths where the files have be installed to.

rpm -ql samba

- /usr/bin/addtosmbpass







-a = Show a list of all packages installed on your system.

This one comes in handy when you want to check whether a certain package

is installed on the system. Just pipe the output of this to grep and you

can check whether a package is installed or not.

rpm -qa | grep samba

- samba-2.0.6-62

-p = This has to be used with the -q switch. Do this if you want to query

a file instead of the rpm database. All the other options given above

work as expected. Only -a will not work since only one kind of query can

take place at a time.

rpm -qi samba

Will query the rpm database for information regarding the Samba

package which is already installed on the system.

rpm -qip samba-2.0.7-20000425.i386.rpm

Will query the file named samba-2.0.7-20000425.i386.rpm.

For normal usage, the above commands will do most of your work. RPM has a

wealth of options. The man page is a good place to study all these options

and see what can work for you.