Yum: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (you need sudo; link to OS images)
 
(29 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Package Manager ==
{{stub}}
Yum is [[Wikipedia:Yellow_dog_Updater,_Modified|Yellowdog Updater, Modified]], a tool for managing Red Hat [[rpm]] [[Wikipedia:Software_package_(installation)|packages.]]

Yum is Yellowdog Updater, Modified, a tool for managing Red Hat [[rpm]] packages.


To install a particular RPM on the XO, in a [[Terminal Activity|terminal]] enter
To install a particular RPM on the XO, in a [[Terminal Activity|terminal]] enter

sudo yum install ''package name''
sudo yum install ''package name''


''package name'' refers to the specific name of the software to be installed. For example, installing a common web server, the package name might be ''apache''
(somebody that knows needs to explain what ''package name'' can be)

For more on yum, on the XO, type in a terminal


For more on yum, on the XO, enter
yum -h
yum -h


On other linux systems that have "man"
On other Linux systems that have "man", enter

man yum
man yum


or on any many Red Hat or related Linux system that uses "yum" and "info"
or on many Linux system that use "yum" and "info", but only if you are familiar with "info" or "emacs", enter
and ONLY IF you are familiar with "info" or "emacs"

info yum
info yum


Line 25: Line 19:
Note: To save space, OLPC [[OS images]] are configured to not extract documentation from rpm packages to the file system.
Note: To save space, OLPC [[OS images]] are configured to not extract documentation from rpm packages to the file system.
If there is a specific package for which you might want this overturned, edit the file:
If there is a specific package for which you might want this overturned, edit the file:
/etc/rpm/macros.pilgrim
/etc/rpm/macros.imgcreate
and change the line:
and change the line:
%_excludedocs 1
%_excludedocs 1
Line 35: Line 29:
By default, any packages you install with yum will be removed during the next update, since our update mechanism always aims to provide a clean system install.
By default, any packages you install with yum will be removed during the next update, since our update mechanism always aims to provide a clean system install.


If you want to install packages that will persist across updates, first obtain a [[developer key]]. Then, as root:
If you want to install packages that will persist across updates, first obtain a [[developer key]]. Then, as [[root]]:


# yum install yum-utils
# yum install yum-utils
Line 43: Line 37:
$ mkdir -p /home/olpc/.custom/rpms
$ mkdir -p /home/olpc/.custom/rpms
$ cd /home/olpc/.custom/rpms
$ cd /home/olpc/.custom/rpms
$ yumdownloader --resolve <pkgname>
$ sudo yumdownloader --resolve <pkgname>
$ rpm -Uvh *.rpm
$ sudo rpm -Uvh *.rpm


This will download the RPM files needed to install <pkgname> into the <code>~olpc/.custom/rpms</code> directory. When you upgrade to a new build, on first boot the <code>olpc-configure</code> program will check your developer key and then install all the RPMs found in that directory.
This will download the RPM files needed to install <pkgname> into the <code>~olpc/.custom/rpms</code> directory. When you upgrade to a new build, on first boot the <code>olpc-configure</code> program will check your developer key and then install all the RPMs found in that directory.
Line 55: Line 49:


See <trac>6432</trac> for more discussion of this feature. This code was written for the 8.2 release and first appeared in joyride-2106. It is not present in 650 (7.1), 653 (7.1.1), 656 (7.1.2), 703 (8.1), 708 (8.1.1), 711 (8.1.2) or 714 (8.1.3).
See <trac>6432</trac> for more discussion of this feature. This code was written for the 8.2 release and first appeared in joyride-2106. It is not present in 650 (7.1), 653 (7.1.1), 656 (7.1.2), 703 (8.1), 708 (8.1.1), 711 (8.1.2) or 714 (8.1.3).

==Tips==

=== /var/tmp ===

On OLPC OS, /var/tmp is a temporary filesystem (tmpfs) with a limited size. This may restrict the use of yum, especially for operations such as whatprovides. The workarounds are either:

* remove /var/tmp from /etc/fstab and reboot; this reconfigures the system to use slower internal storage for temporary files, or;
* increase the size of the tmpfs,
mount -o remount -o size=128M /var/tmp

=== Memory Limitations ===

On the XO-1, yum is slow and may require more memory than is available, depending on the transaction. This can cause Yum to fail. Solutions are to use the [[OSBuilder]], add [[Swap]], or stop the display manager:
service olpc-dm stop


==External References==
==External References==


*[http://prefetch.net/articles/yum.html Managing Packages with Yum] - including finding installed packages, and searching for more
*[http://www.phy.duke.edu/~rgb/General/yum_HOWTO/yum_HOWTO/yum_HOWTO.html Yum HOWTO]
*[http://www.phy.duke.edu/~rgb/General/yum_HOWTO/yum_HOWTO/yum_HOWTO.html Yum HOWTO]
*[http://dag.wieers.com/rpm/mega-merge.php Yum repositories]
*[http://dag.wieers.com/rpm/mega-merge.php Yum repositories]
*[http://www.phy.duke.edu/~rgb/General/yum_HOWTO/yum_HOWTO/yum_HOWTO-10.html#ss10.1 /etc/yum.conf]
*[http://www.phy.duke.edu/~rgb/General/yum_HOWTO/yum_HOWTO/yum_HOWTO-10.html#ss10.1 Setting up the Yum Client]


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

Latest revision as of 03:41, 19 August 2014

Package Manager

Yum is Yellowdog Updater, Modified, a tool for managing Red Hat rpm packages.

To install a particular RPM on the XO, in a terminal enter

sudo yum install package name

package name refers to the specific name of the software to be installed. For example, installing a common web server, the package name might be apache

For more on yum, on the XO, enter

yum -h

On other Linux systems that have "man", enter

man yum

or on many Linux system that use "yum" and "info", but only if you are familiar with "info" or "emacs", enter

info yum

Documentation

Note: To save space, OLPC OS images are configured to not extract documentation from rpm packages to the file system. If there is a specific package for which you might want this overturned, edit the file:

/etc/rpm/macros.imgcreate

and change the line:

%_excludedocs 1

to:

%_excludedocs 0

before installing it. Remember to switch it back after you are done.

Making persistent changes

By default, any packages you install with yum will be removed during the next update, since our update mechanism always aims to provide a clean system install.

If you want to install packages that will persist across updates, first obtain a developer key. Then, as root:

# yum install yum-utils

Then, as the olpc user:

$ mkdir -p /home/olpc/.custom/rpms
$ cd /home/olpc/.custom/rpms
$ sudo yumdownloader --resolve <pkgname>
$ sudo rpm -Uvh *.rpm

This will download the RPM files needed to install <pkgname> into the ~olpc/.custom/rpms directory. When you upgrade to a new build, on first boot the olpc-configure program will check your developer key and then install all the RPMs found in that directory.

This is handy in order to ensure (for example) that emacs is always installed on your builds.

If you use this feature a lot, you may find it more convenient to create subdirectories under ~olpc/.custom/rpms for each major program you install, so that you can more easily keep track of which rpms go which what program. The first boot installation will look through all of the subdirectories of ~olpc/.custom/rpms to find RPMs it should install.

(Note also that if you wish to make regular additions to the .custom/rpms directory that you'll probably want to put the yum-utils rpm itself into that directory, so that yumdownloader is always available.)

See <trac>6432</trac> for more discussion of this feature. This code was written for the 8.2 release and first appeared in joyride-2106. It is not present in 650 (7.1), 653 (7.1.1), 656 (7.1.2), 703 (8.1), 708 (8.1.1), 711 (8.1.2) or 714 (8.1.3).

Tips

/var/tmp

On OLPC OS, /var/tmp is a temporary filesystem (tmpfs) with a limited size. This may restrict the use of yum, especially for operations such as whatprovides. The workarounds are either:

  • remove /var/tmp from /etc/fstab and reboot; this reconfigures the system to use slower internal storage for temporary files, or;
  • increase the size of the tmpfs,
mount -o remount -o size=128M /var/tmp

Memory Limitations

On the XO-1, yum is slow and may require more memory than is available, depending on the transaction. This can cause Yum to fail. Solutions are to use the OSBuilder, add Swap, or stop the display manager:

service olpc-dm stop

External References