Basic, handy rpm commands

Even though I’m comfortable on the command line (and regularly use Cygwin on Windows, and Terminal on the Mac), I haven’t used Red Hat Linux (or CentOS) since probably 2003, and so I’m not very familiar with rpm (“RPM Package Manager“, or formerly, “Red Hat Package Manager”). I started by looking at the man page, which is a great way to look up a particular command-line argument but is not necessarily the best way to learn just what I need right now. For that, Google often works better, and indeed this Quick Guide fit the bill perfectly.

After installing MarkLogic Server on my new EC2 instance, I wanted to poke around some. Here are the simple commands that came in handy:

rpm -i MarkLogic-4.2-1.i686.rpm
Installs MarkLogic from the RPM package
rpm -qa
Lists all the packages installed on this machine (“query all”)
rpm -qa | grep MarkLogic
Searches for “MarkLogic” among that list (revealing its title as “MarkLogic-4.2-1″)
rpm -qi MarkLogic-4.2-1
Shows info about this package (“query info”)
rpm -ql MarkLogic-4.2-1

Shows all the files created as a result of installing this package (“query list”)

Yep, very basic and nothing to write home about. But blogging about it might help me remember. Most Unix commands have a ton of options, many of which I’ll never need. But it’s good to be able to remember some of the most common ones and only visit the man page when I need to do something unusual.

Leave a Comment