Local YUM fun

If you’re installing redhat on a machine without Internet access you may wish to setup a local YUM repository for extra bits and pieces after the main install.

Add the following to /etc/yum.repos.d/local.repo. If there are any other .repo files in /etc/yum.repos.d then comment out their contents. Make sure you don’t have spaces in your baseurl.


Now run the following.

yum clean all
yum update


“Options Error: Error parsing ‘file:///media/Foo DVD/’: URL must be http, ftp, file or https not “: There are probably spaces in your baseurl. Try copying or symlinking to a path without spaces. This a known bug.

media://1161132068.269978%232/Fedora/RPMS/libgcj-4.1.1-30.x86_64.rpm: [Errno 4] IOError: : This is because primary.xml.gz has references to media:// instead of file://. You can edit primary.xml and gzip it up again. Just be sure to update your checksums… see next point.

[Errno -1] Metadata file does not match checksum: Perhaps you edited one of the XML files manually?
The value for the open checksum refers to the sha1sum of the file before it is gzipped. The other value is the checksum of the .gz file itself.

<data type="primary">
<location href="repodata/primary.xml.gz"/>
<checksum type="sha">df5db17cabcfa41678af129593b362cb5b7efe61</checksum>
<open-checksum type="sha">def5dff9b10e23340df230c3f81c9f6f43ba3ef2</open-checksum>

Steps for editting primary.xml

# extract
gunzip primary.xml.gz

# edit
emacs primary.xml
# value for "open checksum"
sha1sum primary.xml

# re-zip
gzip primary.xml
# value for regular checksum.
sha1sum primary.xml

# fix checksums
emacs repomd.xml

# rebuild
yum clean all
yum update

Leave a comment

Your email address will not be published.