Creating an internal yum repository for RHEL packages

Learn more about how to create an internal yum internal repository using the Apache HTTP server.

Setting up a Web server

To host an internal repository, you must install or use an existing Web server on an internal host and then download the repository files to the Web server host. The examples in this section use Apache HTTP Server as the Web server.
  1. Install Apache HTTP Server:
    sudo yum install httpd
  2. Start Apache HTTP Server:
    sudo systemctl start httpd

Downloading and publishing the package repository for the CDH client

  1. Download the package repository of CDH client that you want to install.
  2. Download the files for a CDP Private Cloud Base release:

    • Run the following command to create a local repository directory for the Cloudera package repository:
      sudo mkdir -p /var/www/html/cloudera-repos/cdh-client
    • Run the following command to modify the file permission that allows you to download the files under the local repository directory:

      sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cdh-client 
    • Copy the files to the yum directory.
  3. Visit the repository URL http://<web_server>/cloudera-repos/ in your browser and verify that the files you downloaded are present.

Creating a temporary internal repository

You can create a temporary remote repository to deploy packages on a one-time basis. Cloudera recommends using the same host that runs CDP Private Cloud Base or a gateway host. This example uses Python SimpleHTTPServer as the Web server to host the /var/www/html directory, but you can use a different directory.
  1. Download the repository. You need to follow the instructions in "Downloading and publishing the package repository for the CDH Client".

  2. Determine a port that your system is not listening on. This example uses port 8900.

  3. Start a Python SimpleHTTPServer in the /var/www/html directory:
    cd /var/www/html
    python -m SimpleHTTPServer 8900
  4. Serving HTTP on 0.0.0.0 port 8900 ...

  5. Visit the repository URL http://<web_server>:8900/cloudera-repos/ in your browser and verify the files you downloaded are present.

Configuring hosts to use the internal repository

After creating the repository, modify the client configuration to use it:
Operating System Procedure
RHEL compatible

Create /etc/yum.repos.d/cloudera-repo.repo files on cluster hosts with the following content, where <web_server> is the hostname of the Web server:

[cloudera-repo]

name=cloudera-repo

baseurl=http://<web_server>/<cdh-client >

enabled=1

gpgcheck=0

SLES

Use the zypper utility to update client system repository information by issuing the following command:

zypper addrepo http://<web_server>/<cdh-client>

Ubuntu

Create /etc/apt/sources.list.d/cloudera-repo.list files on all cluster hosts with the following content, where <web_server> is the hostname of the Web server:

deb http://<web_server>/<cdh-client><codename> <components>

You can find the <codename> and <components> variables in the ./conf/distributions file in the repository.

After creating the .list file, run the following command:

sudo apt-get update