RPMing the night away!

In my previous post I covered some tips about using apt and dpkg, Debian-based package tools. Red Hat/Fedora-based distributions also have useful sets of command line tools for package management, namely rpm and yum. Some of the tools work in a similar fashion, some have other features. I'm just going to cover the ones I've found handy.

Querying if a package is installed

rpm -qa | grep inkscape

Similar to the dpkg command, rpm can list all (or in this case query all - qa) packages. Using pipe | and the grep command we can search for a particular package, in this case inkscape. I sometimes also use the redirection symbol to redirect a query all listing to a text file. e.g.

rpm -qa | grep graphics > textfilename.text

In the example above I query all the packages and use the grep command to pattern match for the word graphics. Any package that has the word graphics in the description or filename will have its filename inserted into textfilename.text - which I can read with vi, gedit, or another editor.

Querying what a package is

Sometimes you want to know more information about an installed package. e.g.

rpm -qi inkscape

The result looks something like:

Name : inkscape Relocations: (not relocatable)
Version : 0.45.1 Vendor: Fedora Project
Release : 1.fc7 Build Date: Wed 21 Mar 2007 05:53:12 AM EDT
Install Date: Sat 08 Mar 2008 09:13:19 AM EST Build Host: hammer2.fedora.redhat.com
Group : Applications/Productivity Source RPM: inkscape-0.45.1-1.fc7.src.rpm
Size : 48505214 License: GPL
Signature : DSA/SHA1, Fri 18 May 2007 03:34:48 PM EDT, Key ID b44269d04f2a6fd2
Packager : Fedora Project <http://bugzilla.redhat.com/bugzilla>
URL : http://inkscape.sourceforge.net/
Summary : Vector-based drawing program using SVG
Description :
Inkscape is a vector-based drawing program, like CorelDraw® or Adobe
Illustrator® from the proprietary software world, and Sketch or Karbon14 from
the free software world. It is free software, distributed under the terms of
the Gnu General Public License, Version 2.

Inkscape uses W3C SVG as its native file format. It is therefore a very useful
tool for web designers and as an interchange format for desktop publishing.

It has a relatively modern display engine, giving you finely antialiased
display, alpha transparencies, vector fonts and so on. Inkscape is written in
C and C++, using the Gtk+ toolkit and optionally some Gnome libraries.

Installing Software

As you may have noticed rpm acts much like dpkg. It's possible to install software with both rpm and dpkg on their respective systems, but often what happens is something we lovingly know as dependency hell. The gist of dependency hell is that software packages usually depend on other software packages. Apt and yum will install packages that other packages depend on, but rpm and dpkg do not.

yum install inkscape

Searching for Software to install

Just as you can install software from yum, it also can be used to search for software, much like the debian apt-cache command:

yum search vector

The example above will search for the word vector in the package.

These are just a few examples of useful commands under rpm-based systems. Many distributions feature different graphical tools, but the command-line tools are normally the same between rpm-based distributions, and therefore are quite handy to know.

 

Cheers,

 

Charles