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:
- mkdir -p /usr/share/repository
2. Create the RPM repository, and copy all the RPMs you want to use into that directory:
- cd /usr/share/repository
- createrepo .
- 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:
- cat /etc/yum.repos.d/file.repo
[base] name=RHEL_5_Repository baseurl=file:///export/pacotes_rh enabled=1
4. Show the package list:
- yum list
5. Now you can install any packages you want, for example:
- yum install httpd