2.1. Creating Your Own Fedora RepositoryIn this section, you'll learn the basic process for creating a Fedora repository. It relies on the yum commands, so you'll learn the details in Chapter 7. For the most part, this section is a high-level overview; it can help you contrast the requirements for patch management for networks based on Fedora, RHEL, and RHEL rebuild distributions. If you're configuring a repository, it's normally best if you create a dedicated partition for that repository. This section assumes that you've installed a new hard drive for this purpose and details the steps that you would take to create a dedicated partition. 2.1.1. Installation RequirementsUnlike with the Red Hat Network Proxy Server, there are no specific hardware requirements for a Fedora repository. Software requirements are fairly minimal. But the demands on a Fedora-based patch repository are the same. Other Fedora computers on your network will pull updates from your local repository on a regular basis. Therefore, on a Fedora-based patch repository, you should consider the following: HardwareAn ideal Fedora repository computer should meet the requirements associated with a Red Hat Network Proxy Server, as described in Chapter 1. To review, while CPU speed is less important, you should have a computer with the following:
Hard Drive PartitionsWhen you configure Fedora as a patch management computer, it is best to set up a dedicated partition for the purpose. In this way, other programs that you might install and other services with ever-growing log files won't crowd out your repositories (or vise versa). Normally, patches are downloaded to the /var directory. Red Hat, Fedora, Debian, and SUSE all follow this convention. Red Hat and Fedora patch RPMs are normally downloaded to /var/spool/up2date and then deleted after the RPMs are used to update your system. As you learned in Chapter 1, Fedora clients are configured through files such as /etc/yum.conf or in the /etc/yum.repos.d directory to pull updates from FTP or HTTP servers. Therefore, most administrators create Fedora repositories on a local FTP or HTTP server. The default directories for associated files are /var/ftp/pub and /var/www/html. If you want to protect the space assigned to your repositories, you'll want to dedicate a partition for this purpose. Note You can also use an NFS server as a repository. I focus on HTTP and FTP because the details are more intricate. Space RequirementsCompared with the space available on the latest inexpensive hard drives, the space required for a Fedora repository is not terribly significant. All you need is room for the operating system and the repository. However, if you manage multiple repositories for multiple versions of Fedora on more than one architecture, you can still run out of room quickly. It's best if you plan ahead. If you plan to reinstall Fedora on your computers every time a new version is released, the requirements are straightforward; one possible scenario with an installation and update repository for x86 systems is shown in Table 2-1. This is just a hypothetical breakdown; I've tried to be generous with space requirements.
That doesn't seem so bad. With these requirements, it seems like you can install a Fedora repository on an older computer with a 10GB hard drive. As long as you make sure that your network can handle the load, this seems to be sufficient. But you need to consider additional factors:
Personally, I enjoy installing Linux on my computers. However, preserving the configuration and personal files associated with older versions can be a tedious process. After Linux is installed, you may not want to reinstall another version until there are significant changes, such as a major new kernel. It's normally two or three years between major kernel releases (such as between versions 2.4 and 2.6). By then, you could be maintaining client computers with multiple architectures. It's easy to see how a repository could grow to hundreds of gigabytes. Creating a Dedicated Partition During InstallationIt's easiest to configure partitions for Fedora Core during the installation process. The Disk Druid screen shown in Figure 2-1 allows you to dedicate partitions or logical volumes to the directory of your choice. Figure 2-1. You can configure partitions with Fedora Disk DruidIn Disk Druid, just click Add, and then you can assign a directory such as /var/ftp to a partition such as /dev/hda5. Alternatively, if there's room on a Logical Volume Management (LVM) physical volume (PV), you can assign space from that area for your repository. Creating a Dedicated Partition After InstallationYou can still configure a dedicated partition for your repository after Linux is installed. All you need is sufficient free space on an available hard drive. For example, assume that you've added a second hard drive on your computer and want to dedicate that space to a repository. You could then use fdisk to create a new partition on that drive. Just take the following steps:
Note For more information on fdisk and partitions, see the Linux Partition HOWTO at www.tldp.org/HOWTO/Partition/index.html. After you've created a new partition, the remaining steps are straightforward. All you need to do is format the partition, mount it on a temporary directory, copy existing data, and then bring the result into your partition table. The next time you boot Linux, it'll boot the desired directory on your new partition automatically. For details, take the following steps:
Configuring Fedora for a New Repository ComputerIf you haven't already done so, you should run the Update Agent on this computer. Before you use it as a repository for other computers on your network, you should make sure this computer itself is up to date! The steps are quite similar to those you've seen for RHEL in Chapter 1; one major difference is that you do not have to register your Fedora Linux computer on the Red Hat Network. 2.1.2. Creating a RepositoryNow that you have a dedicated partition, you can create the repository that you need for the computers on your network. While we detail the process in later chapters, we describe the basic steps here:
Note If you're creating a repository for Fedora Core 3 or later, the tools have been changed. The standard command is yum-arch; those who create yum repositories are moving toward the createrepo command. We'll discuss the use of both tools in Chapter 6, "Configuring a yum Client," and Chapter 7, "Setting Up a yum Repository." Selecting a ServiceAs described in Chapter 1, Fedora clients pull updates from FTP and HTTP (Web) servers. You learned how to point a Fedora client to a FTP or HTTP mirror. You'll want to create your repository on an FTP, NFS, or HTTP server, which is what Fedora users are familiar with. While I personally prefer FTP because the protocol is inherently faster, some prefer the security associated with an HTTP (or even an HTTPS) server. After you choose a service, you should set up a dedicated partition, as described earlier in this chapter. Then you can install and configure the service of your choice. We'll show you how to configure a yum repository on a vsFTP server in Chapter 7. Planning the TreeNext, you'll need to plan the directory structure. The simplest plan is to mirror an existing repository from a server connected to the Internet. But as many repositories are configured for multiple architectures, mirroring may download much more than what you need. There is a substantial number of directories associated with Fedora Core repositories. If you don't need development, testing, or source packages, you do not need all the standard repository directories on your system. In fact, you may want to discourage users from downloading and installing developmental packages, because they may have unpredictable effects on your system. For the latest releases of Fedora Core, you may need to justify your use of different repository directories. Some of the options include
Unless you're a Fedora developer, you don't want or need most of these directory trees in your repository. Downloading and SynchronizingNow that you know what you want to download, you can proceed with the process. With the right command, such as rsync or wget, you can download the repository trees of your choice. We'll describe this process in more detail in Chapter 7. There are a number of developers who have automated this process. Note You can use the basic directions in Chapter 3, "SUSE's Update Systems and rsync Mirrors," to create a local mirror of any repository with the rsync command. While Chapter 3 applies to SUSE, the basic commands apply to any repository on an rsync server. |