Rpm: Difference between revisions

From OLPC
Jump to navigation Jump to search
(new section for querying installed packages)
m (→‎Installing a package: consistent italics)
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:


rpm -q ''package''
rpm -q ''package''
displays information about a package, but you have to know the package. So it's easier to query all packages and search for a string:
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 of name''
rpm -qa | grep ''part''


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


'''Example'''
'''Example'''


There's an [[evince]] library for document viewing, does the XO use it?
There's a libpoppler library for PDF handling, is it on the XO, and what software uses it?
rpm -qa | grep evince
'''rpm -qa | grep poppler'''
sugar-evince-2.20.1.1-3.olpc3.i386
poppler-0.6.2.5.olpc3.i386
'''rpm -q --whatrequires poppler'''
sugar-evince-python-2.20.1.1-3.olpc3.i386
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 &mdash; the [[Read]] activity uses this [[Evince]] library.


== Installing a package==
== Installing a package==
Line 24: Line 38:
Generally, you can install a package with 'rpm' like this:
Generally, you can install a package with 'rpm' like this:


sudo rpm -ivh 'desired_software_package.rpm'
su
rpm -ivh 'desired_software_package.rpm'
exit


That is, you use [[su]] to switch to "superuser" (or "root") mode, 'rpm' to install the software, then 'exit' from "superuser" mode. Note the single-quote characters (') around the filename. They are optional, but may be needed if the filename contains spaces or unusual characters.
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:
You can also use 'rpm' to both download and install the software package in one step:


sudo rpm -ivh '<nowiki>http:</nowiki>//''www.website.com/path/to/desired_software_package''.rpm'
su
rpm -ivh 'http://www.website.com/path/to/desired_software_package.rpm'
exit


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:
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 '<nowiki>http:</nowiki>//''www.website.com/path/to/desired_software_package.rpm'''
wget '<nowiki>http:</nowiki>//''www.website.com/path/to/desired_software_package''.rpm'
sudo rpm -ivh '<i>desired_software_package</i>.rpm'
su

rpm -ivh 'desired_software_package.rpm'
You can read more about [[rpm]] at the [http://www.rpm.org/ rpm homepage].
exit


== OLPC RPMs ==
You can read more about 'rpm' at the [http://www.rpm.org/ rpm homepage].
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/.


[[Category:Package management]] [[Category:Linux software]]
[[Category:Package management]] [[Category:Linux software]]

Latest revision as of 02:30, 8 September 2010

'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/.