This article explains how to install packages via Yum command using DVD as repo. If you want to install some packages that are not installed by default and you have an Enterprise Linux (Oracle Linux, or RedHat) DVD/ISO file, so you can create a repository file to install your packages with an automatic packages dependency.
Table of Contents:
– Yellowdog Updater, Modified
– Create repository File
1. Yellowdog Updater, Modified (YUM):
Yum is the Red Hat package manager that is able to query for information about available packages, fetch packages from repositories, install and uninstall them, and update an entire system to the latest available version. Yum performs automatic dependency resolution on packages you are updating, installing, or removing, and thus is able to automatically determine, fetch, and install all available dependent packages, for more info.
1.1. Mounting the DVD:
When you put your dvd in the DVD driver, Entreprise Linux mount the DVD automaticly if you are using the graphical desktop (Ctrl+Alt+F7 with init 5), if not mount your dvd using the command mount.
– To check the mount:
1.2. Check that the directory repodata is in the DVD:
The repodata directory contains the metadata of files/packages ( to solve dependency).
- For Oracle Linux 6/RedHat 6:
The DVD of Oracle Linux 6 and Redhat Enterprise Linux 6 include by default the directory repodata.
- For Oracle Linux 5 (tested with OL 5u9):
The DVD of Oracle Linux 5 and Redhat Enterprise Linux 5 include the repodata directory under teh directory Server.
# cat /etc/yum.repos.d/local.repo [Local-DVD] name=DVD baseurl=file:///var/www/html/dvd/Server enabled=1 gpgchek=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
2. Create repository file (example: Linux 6):
Now, it is time to create a repository file:
Where [DVD] is a unique repositoryID, and name is a description of what the repository contains, and baseurl is the location of the ftp/http/file URL of the repository, and enabled is to enable the repository, and gpgcheck is to check the integrity of all packages with gpgkey.
The yum command:
The following command examples and descriptions illustrate the major features of yum:
- Search for firefox package:
# yum search firefox
- Install firefox package
# yum install firefox
- Update firefox:
# yum update firefox
- Show package header information:
# yum info firefox
- Remove firefox package:
# yum remove firefox
- When errors occur regarding corrupted repository data:
# yum clean (headers| packages| metadata| dbcache | plugins | expire-cache | rpmdb | all)
You can use the yum option –y to answer any prompt by yes.
# yum -y update
This article provides the basic yum repository configuration steps using a DVD repo.
Pingback: Wadhah DAOUEHI - Set up NTP Server on Linux Server