Utilizando YUM para instalar pacotes RPM


Issue
yum can be used to update or install packages for Red Hat Enterprise Linux 5 from a customised repository.

Environment
Red Hat Enterprise Linux 5

Resolution
To use yum to install or update packages from an ISO file, you will need to make your own repository. There are two methods for doing this:

Method 1
  1.  Create the folder that will hold the repository:
  1. mkdir -p /usr/share/repository

2. Create the RPM repository, and copy all the RPMs you want to use into that directory:
  1. cd /usr/share/repository
  2. createrepo .
  3. yum clean all
Note: The createrepo package needs to be installed on the system in order to run the following commands.

  3.  Create the file /etc/yum.repos.d/file.repo as follows:
  1. cat /etc/yum.repos.d/file.repo
[base] name=RHEL_5_Repository baseurl=file:///export/pacotes_rh enabled=1

  4.  Show the package list:
  1. yum list

  5.  Now you can install any packages you want, for example:
  1. yum install httpd