Red Hat Certified System Administration 8



Exercise 04 : Creating Your Own Repository

To perform this exercise, you need to have access to the RHEL or CentOS installation disk or ISO file.
  1. Insert the installation disk in your virtual machine and make sure it is attached and available.

  2. Type mkdir /repo so that you have a mount point where you can mount the ISO file.

  3. Add the following line to the end of the /etc/fstab configuration file: /dev/sr0 /repo iso9660 defaults 0 0

  4. Type mount -a, followed by mount | grep sr0. You should now see that the optical device is mounted on the directory /repo. At this point, the directory /repo can be used as a repository.

  5. At this point, two repositories are available through the /repo directory. The BaseOS repository provides access to the base packages, and the Application Stream (AppStream) repository provides access to application streams (these repositories are described in more detail in the “Managing Package Module Streams” section later in the chapter). To make them accessible, you need to add two files to the /etc/yum.repos.d directory. Start with the file BaseOS and give it the following contents:

    [BaseOS]
    name=BaseOS
    baseurl=file:///repo/BaseOS
    gpgcheck=0

  6. Next, add the file /etc/yum.repos.d/AppStream.repo with the following contents: Click here to view code image

    [AppStream]
    name=AppStream
    baseurl=file:///repo/AppStream
    gpgcheck=0

  7. Type yum repolist to verify the availability of the newly created repository. It should show the name of the myrepo repository, including the number of packages offered through this repository (see Example 9-3). Notice that if you’re doing this on RHEL, you’ll also see a message that this system is not registered to Red Hat Subscription Management. You can safely ignore that message.

Eninam BAGNABANA     |         |     bagnadavid@outlook.fr     |