Skip to content.

What is Yum?

Yum is a tool that eases the installation process of RPM packages. It is similar to Debian's APT and pkg-get for Solaris, working to resolve and install dependencies to automate the package installation process. Yum also has the ability to perform system upgrades, search for packages in a repository and perform other helpful tasks. Yum configuration and repository listings are stored on the local host in /etc/yum.conf.

Setting up Yum on a client

  • First determine what version of Red Hat your computer is running and the architecture.
    • cat /etc/redhat-release should return something like:
      • Red Hat Enterprise Linux WS release 4 (Nahant Update 4)
      • Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
      • Red Hat Enterprise Linux WS release 3 (Nahant Update 8)
      • Red Hat Linux Advanced Server release 2.1AS (Pensacola)
        • These examples correspond to Red Hat WS4, AS4, WS3 and AS2.1 respectively. Be sure to look at the 'release' version and discard the 'Update' number.
    • uname -i should return either i386 or x86_64. If it returns i486, i586 or i686 treat those as i386.

  • Now you are ready for the actual installation. The basic procedure is to copy the Yum configuration file into place.

  • Yum should now be installed. To test Yum, try executing:
    • yum check-update
      • At this point you should see a list of outdated packages on your system. More importantly, if it does not error out then Yum is working.
      • If Yum happens to error out, contact Jordan Mendler or another SysAdmin?

  • Now that Yum is working you can set up the RHN daemon to monitor Yum instead of up2date. This is optional, but will make allow the update icon in Xwindows to track Yum.
  • NOTE: This feature is only available for Red Hat 3 and 4, so skip this step if you are using AS2.1.
    • sudo mv /etc/sysconfig/rhn/sources /etc/sysconfig/rhn/sources_orig
    • sudo cp /tmp/rhel4as-i386/sources /etc/sysconfig/rhn/
    • sudo /etc/init.d/rhnsd restart

Using Yum

  • Find your package:
    • yum search packagename
    • yum search package description

  • To find what RPM provides a certain file or library:
    • yum provides file
    • (i.e. 'yum provides xclock' returns the various RPMs that contain the xclock binary)

  • To find more details about a given package:
    • yum info packagename

  • Installation:
    • yum install packagename
      • or to bypass confirmation: yum -y install packagename

  • Uninstallation (This will remove the top-level package and any packages that depend on it. This will not remove packages that were installed as dependencies for this package)
    • yum remove packagename
      • yum -y remove packagename

  • System Upgrade:
    • To see available updates:
      • yum check-update

  • To completely upgrade you system and remove obsolete packages:
    • yum upgrade
      • yum -y upgrade

  • To upgrade, but not automatically remove obsolete packages:
    • yum update
      • yum -y update
      • If you run into this issue, as root, run `rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*` and re-run `yum -y update`.
        • warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID
        • Public key for [package] is not installed.

  • To upgrade an individual package you have 3 options:
    • yum update packagename
    • yum upgrade packagename
    • yum install packagename (similiar to 'rpm -U': if the package is not installed it will install it, otherwise it will update it if it is not already the latest version)

References: