Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
RPM (Redat Package Manger) is the most common and and one of the best package managers out there. There are some nice GUI tools, but these really lack the details that some people may need. That is where this RPM Cheat comes in. Here are some usefull commands for working with RPMs at the command line.
rpm -ivh packagename.rpm This simply installs a package.
rpm -Uvh packagename.rpm This simply upgrades a package or install a package fresh, please note that the U is a capitol U.
rpm -qi packagename This give you the descrption of the package, e.g. rpm -qi mozillarpm -qp packagename.rpm This simply querys a package to determine its version number. You can add an i after the qp to get a more thorough descrption.
rpm -qpl packagename.rpm This querys a package to determine its version number and lists all the files that would be installed and where they would go. The package does not need to be installed already to use this.
rpm -e packagename This removes (i.e. uninstalls) a package. Another thing to note is that the rpm suffix is not used
rpm -q packagename Tells the version of packagename. Note is that the rpm suffix is not used for this command either.
rpm -ql packagename This lists all files install by package packagename. Note is that the rpm suffix is not used for this command either.
rpm -qf filename This tells which package a file is a member of. For example rpm -qf /usr/bin/mozilla will tell you that this file is included with the package mozilla.
rpm -qa - list all installed RPM packages on you system. An useful trick is to have this piped into a grep to search for something you havea rough idea of on how to spell e.g. rpm -qa | grep calc to look for all packages whcih have the word calc in them.
For RPM versions 4.0.x or earlier use these commands for building your own RPMs.rpm --rebuild package.src.rpm Builds an RPM for your system when you don't have or can't find a binary. for example: rpm --rebuild fvwm2-2.2.3.src.rpm. The built RPM will be placed in /usr/src/<distroname>/RPMS/i386/ by default, e.g. for Red Hat it will be in /usr/src/redhat/RPMS/i386/.
rpm --rebuild --target [arch] packagename.src.rpm Builds an RPM for a specific architecture which can be nice for CPU optimizations. An example: rpm --rebuild --target athlon galeon-1.0.2.src.rpm . The RPM will be placed in /usr/src/<distroname>/RPMS/<architecture>, e.g. /usr/src/redhat/RPMS/athlon/
For RPM versions 4.1 or higher use these commands for building your own RPMs.rpmbuild --rebuild package.src.rpm Builds an RPM for your system when you don't have or can't find a binary. for example: rpm --rebuild fvwm2-8.1.src.rpm. The built RPM will be placed in /usr/src/<distroname>/RPMS/i386/ by default, e.g. for Red Hat it will be in /usr/src/redhat/RPMS/i386/.
rpmbuild --rebuild --target [arch] packagename.src.rpm Builds an RPM for a specific architecture which can be nice for CPU optimizations. An example: rpm --rebuild --target athlon galeon-1.0.2.src.rpm . The RPM will be placed in /usr/src/<distroname>/RPMS/<architecture>, e.g. /usr/src/redhat/RPMS/athlon/
rpm -Uvh --force packagename.rpm Like it says - it forces an upgrade and/or install. Use at your own risk.
rpm -Uvh --nodeps packagename.rpm Have it ignore dependcy errors. This can be handy when you have one package you know is installed but RPM does not have it in its database.
Stumbled into the same pitfall as everybody starting with RH8.0 I guess.
After searching on the RH 8.0 disks and trying things with the new
"Package Managment" (what you call managment ) I just downloaded
a rpm of the latest GnoRPM package.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.