Rpm

From OLPC
Jump to navigation Jump to search

'rpm' is a command-line utility for downloading, installing, and managing software packages that you run in the Terminal Activity. It is generally better to install packages via the yum utility, but not all software is available this way, so sometimes 'rpm' is the best option. If you are using 'rpm' to download software, the XO will need Wifi_Connectivity.

Querying installed packages

rpm is useful to determine what software is installed on the XO, and why.

rpm -q package

displays information about a package, but you have to know the package. You can query for all packages and search the output for a string:

rpm -qa | grep part

Then you can use rpm -q to query for information about a package, useful options to querying are -i, -l, --requires etc.

Example

There's a libpoppler library for PDF handling, is it on the XO, and what software uses it?

 rpm -qa | grep poppler
 poppler-0.6.2.5.olpc3.i386
 rpm -q --whatrequires poppler
 no package requires poppler
 Let's see if anything depends on its files
 rpm -q -l poppler
 /usr/lib/libpoppler-glib.so.2
 ...
 ...
 rpm -q --whatrequires libpoppler-glib.so.2
 poppler-0.6.2-5.olpc3.i386
 sugar-evince-2.20..1-3.olpc3.i386
 rpm -qi sugar-evince
 ...
 Summary : Document viewer
 Description:
 evince is a GNOME-based document viewer.  This is the version developed for
 OLPC. It is built as a library to support embedding.

Note that Activities don't list their dependencies in rpm — the Read activity uses this Evince library.

Installing a package

Generally, you can install a package with 'rpm' like this:

sudo rpm -ivh 'desired_software_package.rpm'

That is, you use sudo to run a command as "superuser" (or "root"), and the command is 'rpm' to install the software. Note the single-quote characters (') around the filename. They are optional, but may be needed if the filename contains spaces or unusual characters.

You can also use 'rpm' to both download and install the software package in one step:

sudo rpm -ivh 'http://www.website.com/path/to/desired_software_package.rpm'

Sometimes 'rpm' has problems downloading the software package. You can try using wget to download the file, as it can sometimes download files that 'rpm' cannot:

wget 'http://www.website.com/path/to/desired_software_package.rpm'
sudo rpm -ivh 'desired_software_package.rpm'

You can read more about rpm at the rpm homepage.

OLPC RPMs

RPMs for OLPC OS images can be found at http://mock.laptop.org/repos/. Some RPMs for development builds are in http://xs-dev.laptop.org/~cscott/repos/.