Table of Contents
Red Hat Repositories
Red Hat uses repositories to manage the software. Every system comes with the Red Hat subscription channels which are available after you've registered your system. This article is about managing the repositories.
Create A Software Repository
If you have some rpms available which you want to install on a couple of systems you can do so by creating a repository and then adding the repo on the systems you want to install the RPMs on.
createrepo /software/repo
In this command the /software/repo
directory holds the RPMs. This command adds the info yum needs to use the directory as a repo.
Add a Software Repository
You can add custom repo's by adding files to the correct directory. These files should have the following contents:
[label] name=Optional name baseurl=http://softwareserver.local/pub gpgcheck=0/1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release enabled=0/1
Note that if you set the gpgcheck to 0 you don't need the gpgkey.
List all Repositories
yum repolist yum repolist all
Note that yum repolist also lists the repo's that are disabled.
Add Temporary Software Repo from Installation DVD
An installation medium is by default formatted as a repo, so just mounting it and adding it to the list of repo's is enough to make it possible to install software from it.
First mount the dvd:
mkdir /mnt/cdrom; mount -o loop /dev/cdrom /mnt/cdrom
Add the repository by going to the /etc/yum.repos.d
directory and create a file. The name doesn't matter that much as long as it ends on .repo:
[root@redhatbox yum.repos.d]# vi dvd.repo [dvd] baseurl=file:///mnt/cdrom/Server enabled=1 gpgcheck=0
Note: If you receive this error:warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Public key for xorg-x11-drv-intel-2.16.0-1.el6.x86_64.rpm is not installed
You forgot to add the line “gpgcheck=0” in the .repo file.
Use the Repo
You can now user the repository to install for example the gnome desktop environment:
yum grouplist yum groupinstall "X Window System" "GNOME Desktop Environment" yum groupinstall "Development Tools"
For more information regarding yum see Red Hat Software