Yum: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (Reverted edits by 200.80.122.194 (Talk) to last revision by Quozl)
Line 27: Line 27:
before installing it. Remember to switch it back after you are done.
before installing it. Remember to switch it back after you are done.


==Making persistent changes==
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">==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.</span> == Apporter des changements permanents == Par défaut, tous les paquets que vous installez avec yum seront supprimés au cours de la prochaine mise à jour, puisque notre mécanisme de mise à jour vise toujours à fournir une installation du système propre.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">If you want to install packages that will persist across updates, first obtain a [[developer key]].</span> Si vous voulez installer les paquetages qui persistent à travers les mises à jour, d'abord obtenir un [[développeur clé]].</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">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 <code>~olpc/.custom/rpms</code> directory.</span> Puis, comme [[root]]: # yum install yum-utils Puis, tant que l'utilisateur OLPC: $ mkdir-p / home / OLPC / .custom / rpms $ cd / home / OLPC / .custom / rpms $ sudo yumdownloader - -résoudre <pkgname> $ sudo rpm-Uvh *. rpm Ceci va télécharger les fichiers RPM nécessaires à l'installation dans le <pkgname> <code> ~ OLPC / .custom / rpms </ code>.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">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.</span> Lorsque vous passez à une nouvelle construction, au premier démarrage de la <code> olpc-configure </ code> programme va vérifier votre clé développeur, puis installer tous les RPM présents dans ce répertoire.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">This is handy in order to ensure (for example) that emacs is always installed on your builds.</span> Ceci est pratique afin de garantir (par exemple) que emacs est toujours installé sur vos builds.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">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.</span> Si vous utilisez cette fonction un lot, vous trouverez peut-être plus pratique de créer le sous-répertoire ~ OLPC / .custom / rpms pour chaque grand programme que vous installez, afin que vous puissiez plus facilement garder une trace des rpms aller où ce programme.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">The first boot installation will look through all of the subdirectories of <code>~olpc/.custom/rpms</code> to find RPMs it should install.</span> L'installation du premier démarrage va chercher dans tous les sous-répertoires de <code> ~ OLPC / .custom / rpms </ code> pour trouver les RPM il faut installer.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">(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.</span> (Notez également que si vous souhaitez faire des ajouts réguliers de la .custom / répertoire rpms que vous aurez probablement envie de mettre le régime yum-utils lui-même dans ce répertoire, de sorte que yumdownloader est toujours disponible.) Voir <trac> 6432 < / trac> pour plus de discussion de cette fonctionnalité.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">This code was written for the 8.2 release and first appeared in joyride-2106.</span> Ce code a été écrit pour la version 8.2 et est apparu dans joyride-2106.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">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).</span> Il n'est pas présent dans 650 (7.1), 653 (7.1.1), 656 (7.1.2), 703 (8.1), 708 (8.1.1), 711 (8.1.2) ou 714 (8.1.3).</span>
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 <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 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 <code>~olpc/.custom/rpms</code> 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==
==Tips==

Revision as of 16:53, 13 March 2012

This article is a stub. You can help the OLPC project by expanding it.

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-1.3.9-4.i386.rpm

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.pilgrim

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

Memory Limitations

Yum is slow and memory-hungry on the XO-1. From devel.lists.laptop.org, "if we disable by default the fedora repositories, yum runs really quickly and does not download too much metadata." A command to do this is:

yum --disablerepo fedora --disablerepo updates -y update

On recent builds leading to release 10.1.3, there may not be enough memory to use yum. You can adapt to this by:

  • adding swap space on SD card or USB, to free memory when pressure is detected,
  • temporarily unmount some of the tmpfs filesystems, to free memory, especially /var/cache/yum,
    • unmounting /var/cache/yum will write yum data to the root filesystem. This is the way yum normally works, and it reduces future downloads. But if you intend no future downloads, or are packaging the result for deployment, then remove the files (rm -rf /var/cache/yum/*).
  • stopping Sugar, to free memory being used by Sugar,
    • use the command stop prefdm, or switch to runlevel 1.
    • any network connection mediated by Sugar will be terminated, so make a connection using shell commands before trying yum.

Removing Dependencies

When you try to remove packages with yum, it doesn't remove the dependencies. Here is a script that helps you to keep track of those dependencies by logging the outputs of yum.

#!/bin/bash
f=/home/olpc/yumlog/`date +%y-%m-%d`.txt
echo ========================== | tee -a $f
echo yum $* | tee -a $f
echo -------------------------- | tee -a $f
/usr/bin/yum-real $* | tee -a $f && exit 0
echo "??!!" | tee -a $f
echo -e \\n \\n \\n| tee -a $f

Rename /usr/bin/yum to /usr/bin/yum-real, save the script above as /usr/bin/yum and create a directory called /home/olpc/yumlog. Unfortunately "tee" is buffered so you can't see the download-bars and the yes-no-prompt.

External References