Using stmyum

Index



Introduction

From the official YUM web page:

Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm.

yum has a number of advantages over using RPM directly, such as:

  • automatic updates of installed packages
  • automatic checks for newly available and updated packages
  • for each package to be installed, all the dependency packages are installed automatically
  • groups of packages can be installed as a single unit
  • offers increased security as all packages are signed

[Top]


stmyum

The ST yum application is called stmyum to ensure that it does not interfere with any native yum installation. It is located in /opt/STM/STLinux-X.X/host/bin and the PATH environment variable must include this directory to be able to use it.


Installing stmyum in ST Linux Distributions 2.0 and 2.2

The ST Linux 2.3 installer script installs stmyum automatically and uses it to carry out the entire installation. This means that stmyum does not need to be installed separately if the installer script has already been used.

With older distributions (ST Linux 2.0 and 2.2), the stmyum package may need to be installed manually after the initial installation. This package is supplied on the ST Linux distribution CD ROMs or it can be downloaded from the FTP server.

On the CD ROM, the stlinux20-host-yum package is in the ST_Installer/Resources directory, or can be downloaded from the FTP server .

Use the following command to install stmyum from the RPM:

host# rpm -i stlinux20-host-yum-XXX.rpm

The stlinux22-host-yum package is provided with all the other host packages in the STLinux/host directory, or can be downloaded from the FTP server.

Use the following command to install stmyum from the RPM:

host# rpm -i stlinux22-host-yum-XXX.rpm

Configuring stmyum

This section is under construction.

The information that stmyum needs to locate the RPM files for the distribution is held in a configuration file. The file has the path /opt/STM/STLinux-X.X/host/etc/yum.conf.

Note: the STLinux YUM RPM is not shipped with a default yum.conf file.

The STLinux installer script creates a yum.conf file for the installation, which points by default to the location where the CD filesystem was mounted. After installing STLinux from a CD, update (or replace) the yum.conf file so that it searches the STLinux website for future updates.

The stlinux22-host-yum package contains a default yum.conf file. This should be correct for most installations without any further editing. However if you are inside the ST firewall, then we recommend that you edit this file according to the embedded comments, in order to add access to the internal server. This should provide improved download speeds.

Note: You may have to set up your proxy environment variable if you are behind a firewall and need to use a proxy server.

yum.conf file syntax

The yum.conf man page gives a full explanation of all the required and optional fields in the yum.conf file.

To view the man page (which is installed with the ST Linux Distribution yum RPM), you may have to set your MANPATH environment variable.

For example, in BASH type:

host% export MANPATH="/opt/STM/STLinux-X.X/host/man:$MANPATH" 
host% man yum.conf

Using signatures with stmyum

If you have not previously used the ST Linux Distribution installer program, then it is a good idea to manually install the ST Linux public signature key. This is used to confirm that the RPMS are authentic ST Linux packages and is important as you will be installing RPMs as root on your system.

Note: You also need to do this if you get an error message complaining about the key length. This is because some older systems (notably RedHat Enterprise Linux 3) ship with a version of the GPG python bindings which cannot handle long strings. In this case you need to bypass yum, and use RPM directly:

host# rpm --import ftp://ftp.stlinux.com/pub/stlinux/X.X/ST_Linux_X.X/gpg_key

stmyum with proxies

To use yum with a proxy server, set the ftp_proxy or http_proxy environment variable. These are standard environment variables used by many programs which access the Internet; for example, wget and curl.

The choice of variable depends on the protocol used to connect to the STLinux server, as specified in the yum baseurl. This may be different from the protocol you use to connect to the proxy server.

For example, for a non-authenticated proxy server myproxy.com, which has HTTP access on port 1234 and using the BASH shell, type:

host# export ftp_proxy="http://myproxy.com:1234"

For authenticated proxies, the URL can be extended to include the username and password. For example, using the username myuser and password mypassword in the above example we would type (using CSH this time)

host# setenv ftp_proxy "http://myuser:mypassword@myproxy.com:1234"

Normally yum tries to keep a single connection open to the server, whether a proxy server is involved or not (this is called HTTP Keep-Alive). This is generally a performance optimization. However, it is possible that some proxy servers do not work correctly in this mode, which means that it is necessary to disable Keep-Alive. This is done by adding the line:

keepalive=0

either for a specific repository, or in the [main] section if you need to apply it to all servers.

[Top]


Using stmyum

stmyum can be used for:

  • querying installed packages
  • checking for new and updated packages
  • removing existing packages

Examples of some of the most frequently used commands are shown below. Detailed information on the can be found in the man pages.

Note: For all of the examples below, "globs" (wildcards) can be used in the <package name>. This means that names such as stlinux20-st231-* are allowed.

By default, stmyum runs in interactive mode and asks you to confirm any actions that will actually change your system.

Note:This feature can be overridden with the -y option.

Common stmyum general commands

Command Example Description
help stmyum help This gives details of all the commands supported by stmyum
update stmyum update When run without any additional parameters, this command updates every currently installed package. It ensures that all dependencies are satisfied.

Common stmyum package commands

stmyum can perform operations based on single RPM packages in the ST Linux Distribution. Some useful commands are given below.

Command Example Description
install stmyum install stlinux23-sh4-nvi Install the latest version of the named package and ensure that all dependencies are satisfied.
update stmyum update stlinux23-sh4-nvi If run without naming any packages, update updates all currently installed package. If one or more packages are specified, stmyum updates the listed packages only. It all cases, it ensures that all dependencies are satisfied.
info stmyum info stlinux23-sh4-nvi Returns the same information returned by rpm -qi <package>. If the named package is not installed, stmyum obtains this information from the yum repository headers. If the installed version is older than the version found in the repository, stmyum displays both the installed and the repository version information.
provides stmyum provides /opt/STM/STLinux-2.3/devkit/sh4/target/usr/bin/bash Returns the same information returned by rpm -qf <file>. If the named package is not installed, stmyum obtains this information from the yum repository headers.
remove stmyum remove stlinux23-sh4-nvi

Remove the named package, together with all the packages that depend on it, and those that depend on them, recursively. Before it erases any of the packages, stmyum lists the affected packages and asks for confirmation.

This is one way to find all the dependencies of a given package; only take care not to select "Y" at the end, or run stmyum with the -y option.

list stmyum list stlinux23* List varied information about available and installed packages.

Common stmyum group commands

The packages within the STLinux distribution are arranged into groups (host tools, cross-development tools and different categories of target packages). stmyum has specific commands for working with a given group as a single entity, thereby avoiding the need to name each package within the group individually. The most useful group commands are given below.

Command Example Description
grouplist stmyum grouplist List all known groups.
groupinfo stmyum groupinfo "st231 Text" List all the RPM packages belonging to the named group(s). It also indicates if they are "mandatory" installations or "optional".
groupinstall stmyum groupinstall "st231 Text" Install all the RPM packages belonging to the named group(s) and their dependencies.
groupupdate stmyum groupupdate "st231 Text" Update all the RPM packages belonging to the named group(s) and their dependencies.
groupremove stmyum groupremove "st231 Text" Delete all the RPM packages belonging to the named group(s) and their dependencies.

[Top]