Adding Red Hat DVD as a Repository
Introduction
You don’t have a Red Hat subscription or simply no internet connection to connect to the NRH, yet you have the installation DVD that contains all the packages you need!
Here’s how to add the DVD to the repository.
Configuration
DVD
Create a file in /etc/yum.repos.d/redhatcd.repo
|
|
And adapt it with this content:
|
|
Now we’ll clear the cache:
|
|
That’s it, now you can use yum with your DVD.
Local Repository
If you want to use a local repository, copy the “Server” folder from the DVD to a local folder (for example /home/repo/Server).
Now you need to install the createrepo-0.9.8-4.el6.noarch.rpm package (or another version), as well as all necessary dependencies:
|
|
Then run this command if you’re on Red Hat 6:
|
|
Or this command if you’re on Red Hat 5:
|
|
Then create a file /etc/yum.repos.d/local.repo
|
|
You can check the list of repositories with the command:
|
|
Then before installing a package, run:
|
|
Remote Repository
You can install an httpd server, then put the “Server” folder from the DVD to use as a remote yum DVD repository. Here’s an example of client-side configuration:
|
|
For the server part, it’s identical to the local configuration.
FAQ
[Errno -3] Error performing checksum
If you get this kind of message:
http://server/repositories/rhws/5Client/i386/repodata/primary.xml.gz: [Errno -3] Error performing checksum
Trying other mirror.
Error: failure: repodata/primary.xml.gz from dvd-base: [Errno 256] No more mirrors to try.
It’s probably because you’re running the createrepo command without the necessary arguments for Red Hat 5. Brief explanation:
Because RPM packages for Red Hat Enterprise Linux 6 are compressed using the XZ lossless data compression format, and may also be signed using alternative (and stronger) hash algorithms such as
SHA-256, it is not possible to run createrepo on Red Hat Enterprise Linux 5 to create the package metadata for Red Hat Enterprise Linux 6 packages.
The createrepo command relies on rpm to open and inspect the packages, and rpm on Red Hat Enterprise Linux 5 is not able to open the improved Red Hat Enterprise Linux 6 RPM package format.
Resources
Last updated 21 Feb 2012, 16:21 +0200.