Texan Cowboy
Texan Cowboy

Reputation: 31

Copying Centos 6.4 DVD 1 to a folder and using it as a repo works, but DVD 2 returns errors

i downloaded centos 6.4 dvd's 1 and 2 1st one was 4.4 gb 2nd one was 1.4 gb

obviously second one has repo files in it as well.

so mounted them then copied them to 2 folder.

home/a/repo_dvd_1
home/a/repo_dvd_2

and then i added them to the repos

i simply edited the CentOS_Base.repo or whatever that file is called.

i added "enabled=0" to everything and put these on top

[01]
name=01
baseurl=file:///home/a/repo_dvd_1
enabled=1
gpgcheck=0

[02]
name=01
baseurl=file:///home/a/repo_dvd_2
enabled=1
gpgcheck=0

and then i ran

yum clean all

and then i tried searching for php

yum search php

here is the result.

[root@localhost a]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: 01 02
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost a]# 
[root@localhost a]# yum search php
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
01                                                       | 4.0 kB     00:00 ... 
01/primary_db                                            | 4.4 MB     00:00 ... 
file:///home/a/repo_dvd_2/repodata/repomd.xml: [Errno 14] Could not open/read file:///home/a/repo_dvd_2/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: 02. Please verify its path and try again

Upvotes: 0

Views: 1287

Answers (2)

Fred Astair
Fred Astair

Reputation: 121

I know this is an old thread but I just got here looking for a solution of exactly the same thing.

After a while I figured it out by myself: All you need if you want to make a repo from DVD1 and DVD2 (without getting your hands dirty with 'createrepo') is to copy DVD2 rpms (from its 'Packages' subdirectory) into the same directory where you copied the DVD1 rpms ('Packages' if you respected the tree, as you should). This is it:

  1. Mount the DVD2 iso in a directory:

    mount -o loop CentOS-6.4-x86_64-bin-DVD2.iso somedir

  2. Copy all rpms from the 'Packages' subdirectory to the directory where you copied the DVD1 packages in the first place ('home/a/repo_dvd_1/Packages' as per the original poster's post):

    cp somedir/Packages/*.rpm home/a/repo_dvd_1/Packages

  3. Get rid of the DVD2 part in your .repo file ([02] in the original post), leave only the [01] for DVD1, since the list of rpms in DVD1 actually contains those of DVD2.

Now the DVD2 rpm's will be pulled from DVD1 repo.

Have fun!

Upvotes: 1

trez
trez

Reputation: 1

I did it another way.

You can mount both images for example

mkdir myrepo myrepo/dvd1 myrepo/dvd2; 
cd myrepo
mount -o loop CentOS-6.4-x86_64-bin-DVD1.iso dvd1
mount -o loop CentOS-6.4-x86_64-bin-DVD2.iso dvd2

and create your own repo config with createrepo script, but if you call it directly, you will lose groups configuration, on first dvd look at file repomd.xml, there is data type group section, with strange xml file name, which contains group mappings, so you can then call:

createrepo -g dvd1/repodata/2727fcb43fbe4c1a3588992af8c19e4d97167aee2f6088959221fc285cab6f72-c6-x86_64-comps.xml .

of course check this hash name for proper one for your version. This will rescan the iso content and create repodata in myrepo directory, so point yum to it

this is probable not the tidiest solution, but it was the fastest way for me.

Upvotes: 0

Related Questions