Yum-ifying The FTP Installation Server

To make this FTP server a "Yum-friendly" server, the only package I really need is:

To install Yum on the FIS server I just need to get the latest RPM. The easy way, which also leaves the Yum RPMs for my repository of "extra" packages, is this:

  # wget http://linux.duke.edu/projects/yum/download/1.0/yum-1.0.3-1_73.noarch.rpm
  # wget http://linux.duke.edu/projects/yum/download/1.0/yum-1.0.3-1_80.noarch.rpm
  # wget http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.4-1.noarch.rpm
  # rpm -Uvh yum-1.0.3-1_73.noarch.rpm
    ... 'rpm' installs the latest 'yum' for RHL7.3, see below...
  # mkdir -p /var/ftp/pub/redhat/9/extras
  # mv yum-2.0.4-1.noarch.rpm /var/ftp/pub/redhat/9/extras/
  # mkdir -p /var/ftp/pub/redhat/7.3/extras
  # mv yum-1.0.3-1_73.noarch.rpm /var/ftp/pub/redhat/7.3/extras/
  # mkdir -p /var/ftp/pub/redhat/8.0/extras
  # mv yum-1.0.3-1_80.noarch.rpm /var/ftp/pub/redhat/8.0/extras/
The last 4 commands are needed only if you have 7.3 and 8.0 repositories in addition to the version 9 repository created here. The different RPMs are for Red Hat Linux 7.3, 8.0, and 9, respectively. They are separate RPM packages due to differences in 'rpm' and 'python' (and 'python2') packages included in each version. I then run 'yum-arch' (included in the 'yum' rpm package) once to test that it executes and to see how it is supposed to work:
  # yum-arch --help
Since this is just the repository, I don't need to worry about executing 'yum' right now. When I do, I can set it up identically to other machines that will use this repository for updates.

I am going to use 'yum' to update client machines after installation, so I make my FTP RPM repositories "yum friendly" by doing this:

  # RH9=/var/ftp/pub/redhat/9
  # for d in $RH9/RedHat/RPMS $RH9/extras ; do yum-arch $d ; done
    ... 'yum-arch' builds your friendly repositories ...
This server is now optimized for the use of Yum clients, with no detriment to it's use as a regular FTP installation server. A '[package-name].hdr' file is created for each RPM in the repository directories and stored in a 'headers' directory so the clients can simply collect and compile them instead of processing each RPM file itself for dependencies and versions. This speeds up 'yum' on the client a lot, especially the slower ones (P75s and the like, and those on low bandwidth links).

Now I want to make yum configuration as easy (and flexible) as possible on newly installed boxes, so I will create a custom 'yum.conf' file for clients to download and install in '/etc/yum.conf'.

The content of my custom 'yum.conf' file will be something like:

  [main]
  cachedir=/var/cache/yum
  debuglevel=2
  logfile=/var/log/yum.log
  pkgpolicy=newest

  [base]
  name=Example Red Hat Linux $releasever base
  baseurl=ftp://ftp.example.com/pub/redhat/$releasever/RedHat/RPMS/

  [updates]
  name=Example Red Hat Linux $releasever updates
  baseurl=ftp://ftp.example.com/pub/redhat/$releasever/updates/

  [extras]
  name=Example Red Hat Linux $releasever extras
  baseurl=ftp://ftp.example.com/pub/redhat/$releasever/extras/
and it will be located here:
  /var/ftp/pub/yum/yum.conf

The client will download the 'yum.conf' file and replace their '/etc/yum.conf' file with it.

NOTE: The 'updates' part of the configuration is something created in conjunction with the download of new updates. 'yum-arch' needs to be run against that directory (and it's subdirectories) every time new updated packages are added.

Now I am done Yum-ifying the server and prepping it for easy client installation and configuration.