Skip to content
TrySitePrice

RHEL6 Beta: HowTo Use yum Command To Install Packages Without RHN

Best/Tutorial

On Red Hat Enterprise Linux (RHEL) 6 Beta, you can use the yum command to install packages without using the Red Hat Network (RHN) by configuring yum to use a local repository or a repository on a network file system (NFS). Here's how you can do this:

  1. Create a local repository: If you have the packages on your local machine, you can create a local repository by creating a directory to hold the packages, and copying the packages into that directory. For example:

    $ mkdir /myrepo
    $ cp /path/to/packages/*.rpm /myrepo

    Then, create a .repo file in the /etc/yum.repos.d/ directory that points to the local repository:

    $ echo " 
    name=My Local Repositoryrnbaseurl=file:///myrepornenabled=1
    gpgcheck=0" > /etc/yum.repos.d/myrepo.repo

    In this example, the .repo file specifies the name of the repository (My Local Repository), the URL of the repository (file:///myrepo), that the repository is enabled (enabled=1), and that GPG signature checking is disabled (gpgcheck=0).

  2. Use a network file system (NFS) repository: If you have access to an NFS-mounted directory that contains the packages, you can use that directory as a yum repository. For example:

    $ echo " 
    name=My NFS Repositoryrnbaseurl=nfs://server.example.com/path/to/repornenabled=1
    gpgcheck=0" > /etc/yum.repos.d/myrepo.repo

    In this example, the .repo file specifies the name of the repository (My NFS Repository), the URL of the repository (nfs://server.example.com/path/to/repo), that the repository is enabled (enabled=1), and that GPG signature checking is disabled (gpgcheck=0).

rnAfter creating the repository, you can use the yum command to install packages from the repository, just as you would from the RHN. For example:

$ yum install package_name

This will install the package_name package from the repository specified in the .repo file.