Discussion Locked

Local yum repo without copying DVDs?

0 helpful
45 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there a way to create a local yum repository without having to copy the contents of the DVD to the local hard drive? I've got four DVD's and a 20 gig HD. I'd prefer yum attempt to install / update directly from the DVDs.

45 replies

by jmgarvin

I don't know of a way, but with only 20gb, getting it from the mirrors is more efficient at that point...or do you not have network connectivity? If that is the case, you gotta pop in the DVD :-(

(I'm sure you know, but just got to Desktop->System Settings->Add Remove Programs and you can do it from there too)

You might also want to install yumex (a front end for yum that makes it cleaner)

by charliespencer

I've got network connectivity, but I'm assuming the DVD's have got to be faster.

Add / Remove Software and yumex, like yum, default to using repositories over the Internet. This requires setting up an environmental variable for our proxy server. That's what I did on my last Linux install, but I forgot to bookmark one of the many sites with the exact command. In any case, while I haven't learned / memorized how to set up that particular variable, I now know I can successfully Google for the instructions. To me that's almost as good. Also, setting up a permanent proxy server variable requires hard coding my domain password in one or more places, unless I want to manually create the variable each time I log on. I'm not the biggest security freak in the world, but I refuse to key my password in text configuration file. Besides, I'd have to go back and change the coded p/w periodically as my domain p/w changes. If I can get a DVD-based local repository to work for yum, it will also work for Add / Remove and yumex.

I can find instruction on setting up a local repo but they all involve copying the CD or DVD contents. I've chosen finding out how to do it without taking up all my hard drive space as my next windmill to tilt at.

Finally, I've got the damn DVDs and they ought to be good for something besides bike spoke reflectors. I don't know what's on three of them of the four and unless I can get this working, I won't. Sure, I can mount them and look at a bunch of .rpm names, but that won't tell me what the heck they do. Hopefully A / R and yumex will tell me what those apps are a lot quicker than Googling each .rpm name one at at ime.

Editorial - I'm not impressed with a package management tool that defaults to the Internet for updates and has to be beaten into installing packages from CD / DVD. I don't know if this is the standard yum configuration or just the way its set up in Fedora. When I did create the proxy server variable and used the company T1, the first pass of "yum update" took over three hours. That's got to be a killer for Joe Homeuser who has dial-up or no Internet connection at all. Free software is of no value if you can't install it. - End of editorial -

by apotheon

It sounds like you're saying you just want to use the DVDs as your repository. Is that the case? If so, I believe you should be able to do so fairly easily. Check the manpages for YUM for details on how to configure its source repositories (I don't recall how to do that for YUM, since I haven't used Fedora for most of a year and never had to deal with configuring package sources very much even when I did use it). For Debian, it's as simple as adding a line to the /etc/apt/sources.list file. For YUM, it should be similarly simple.

by charliespencer

I received a sample five-line .repo file on FedoraForum. I used it to create a .repo file that will work for the first DVD in the set (Fedora Core). That DVD mounts as /media/disk. Unfortunately, the second one mounts as

/media/Fedora Core 5 Updates

I need to specify that path in the .repo's baseurl parameter, but I can't figure out how to enter the spaces. All baseurl is getting is /media/Fedora. I'm sure there's a simple way to indicate a string has spaces in a configuration file, and I'm betting whatever technique can be used for more than just a .repo file. That's the point I was at when I quit for the day, and I haven't searched for "string variable space" yet.

I tripped over Duke University's yum page. I got the impression they have something to do with yum development. There was an e-mail from February '06 asking that yum incorporate this capability as part of the standard config, and a reply that they were looking into it. It would be nice if it would fail over to the optical drive if the Internet was not available instead of stopping.

by jmgarvin

You have Add Remove Programs (re: my other post) that is far easier and a lot faster*

* yum is probably the worst package manager out there. YaST is far superior and apt-get superior to that.

by apotheon

1. You could create a symlink to that directory somewhere else, and specify that as your repo location. Check the manpage for [b]ln[/b] to learn more about how to create symbolic links. In short, the syntax is [b]ln -s [target] [link name][/b].

2. You might be able to rename the mountpoint using [b]mv[/b] to something without spaces in it. How exactly are you mounting it that it ends up mounted at [b]/media/Fedora Core 5 Updates[/b]?

3. If that's the only thing in /media that starts with "Fedora", you could try specifying [b]/media/Fedora*[/b].

4. You could try single-quoting the string: [b]/media/'Fedora Core 5 Updates'

It may be that when using YUM to access the repository on the DVDs, you just need to have the first DVD in the drive when you start and it'll tell you which DVD to put in when it needs a different one and handle it automaticaly. It may be worth a try.

by apotheon

There's a version of APT that, last I checked, was available for Fedora. It's generally called APT-RPM to distinguish it from the normal Debian version of APT. I don't know how well it works with Fedora, though, since it's not officially supported the way YUM is.

by jmgarvin

However, you can set it up far more easily than yum.

Warning: It is unstable. In Fedora Core 5 things tend to break if you are not careful. DO NOT DOWNLOAD PACKAGES FROM THE WEB VIA APT! You will not have a good time.

apt-rpm http://apt-rpm.org/options.shtml

by charliespencer

I'm not trying to download from the web. That's EXACTLY what I'm trying NOT to do.

Is apt the same thing as apt-rpm? I don't get man pages for either, so I assume neither is installed. Now we're back to how do I install them without being able to access the DVDs.

by charliespencer

1. Worth a try. Symbolic links are already on my list anyway.

2. I not taking any action to mount it; it's mounting itself. I insert the DVD and after several seconds it show up in /media. If I'm in the GUI an icon pops up on the desktop.

3 and 4. Also worth trying, and faster than researching symbolic links. I try those first.

by apotheon

I was afraid of that. I'm not much of a fan of automounting, as it interferes with the user's ability to keep control over what's going on with the system (as you've discovered). This isn't really a problem in Windows, of course, because the filesystem doesn't allow mounting of other filesystems in arbitrary locations within the main filesystem hierarchy. If you want the added flexibility and capability of unix-style filesystem mounting, however, you have to take that into account when determining how mounting should take place.

I haven't seen an automounting system that does a very good job of that, unfortunately.

by charliespencer

jmgarvin, I know I'm asking for help and I have no right to cop an attitude but, c'mon. If I call Car Talk with a question about a Chevy, they don't tell me they don't drive Chevys and I should get a Honda.

As I mentioned in response to your first post, Add / Remove doesn't work now with the default configuration. Everything I've read says it uses the same repositories as yum, so I assume it's trying to pull from the Internet. I'm working on the theory that if I get yum configured to use the DVDs, A / R will do the same, then I can use it instead. Is there a way to configure A / R to use the DVD's as repositories instead of the Internet other than creating a .repo file in /etc/yum.repos.d?

Alternatively, will YaST or apt-get read from the DVDs by default, or will I have to reconfigure them too? Assuming they're on the DVDs, how do I install them?

by stress junkie

I'm only writing this because you mentioned YaST. Apparently YaST doesn't work in some hardware configurations. My recent installation of OpenSuSE v10.1 somehow brought out this broken condition in YaST. I have written about it in my TR blog. I think that it has something to do with having a USB/Firewire external disk.

by charliespencer

It appears the .repos I'm attempting to create are being overridden by those that were predefined during installation.

One of the predefined .repos has a file name of fedora-core.repo. However, the first line is within the file is [core]. So I renamed the file.

mv fedora-core.repo fedora-core

Then I changed my homegrown .repo so the first line is [core] instead of the name I was using. Now I'm getting farther than I was, but not completely there yet. 'yum update' appears to read the Core DVD as the [core] repo, but stops with an error when it tries to read the [update] repo. Looks like I've got some more .repos to rename or modify.

Edited. Now the darn thing is back to "Error parsing 'baseurl'. I know I'm on the right track with the conflicting .repo files because the stinking thing worked (partially) once.

by jmgarvin

Try this:

yum clean all
yum localinstall /media/disk/Fedora/RPMS/package.rpm

Does that work?

by charliespencer

# yum clean all
Options Error: Error parsing 'baseurl': URL must be http, ftp, file or https not ""

I get this same message for 'yum update' and 'yum --version'. I'd expect the app to be able to tell me it's version without having to access repositories, but apparently not.

As for 'yum localinstall', that may work if I had any idea what any of these packages are. I'm reluctant to install something when I don't know what it is. I've already been burned that way once. I'm open to suggestions.

What were your assumptions?

Edited. I tried installing gimp, since I have a clue what that does. I got the .rpm name from the DVD.

# yum localinstall /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm
Loading "installonlyn" plugin
Setting up Local Package Process
Examining /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm: gimp - 2:2.2.10-4.i386
Marking /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm to be installed
Setting up repositories
core [1/3]
core 100% |= =| 1.3kB 00:05
updates [2/3]
Cannot find a valid baseurl for repo: updates
Error: Cannot find a valid baseurl for repo: updates.

The Updates DVD mounts as /media/Fedora Core 5 Updates. Now we're back to my inability to pass a path string with spaces as a repo baseurl.

by jmgarvin

I think we got off on a tangent ;-) Check my post at the bottom and I think that'll work for ya...

by jmgarvin

The path is /etc/yum.conf

Something freaky is in there I think....It shouldn't be looking on the web (which is the error you are getting) to do these things.

by charliespencer

The baseurl's in the two .repo files match what is displayed if I do an ls in the /media directory after the DVD's have self-mounted.

/etc/yum.conf

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800

-----------------------

/etc/yum.repos.d/fedora-core.repo

[core]
name=Fedora Core $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=file:///media/disk
mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[core-debuginfo]
name=Fedora Core $releasever - $basearch - Debug
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[core-source]
name=Fedora Core $releasever - Source baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/source/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

-------------------------------

/etc/yum.repos.d/fedora-updates.repo

[updates]
name=Fedora Core $releasever - $basearch - Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
baseurl=file:///media/'Fedora Core 5 Updates/'
mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[updates-debuginfo]
name=Fedora Core $releasever - $basearch - Updates - Debug
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[updates-source]
name=Fedora Core $releasever - Updates Source
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

by apotheon

When he said you shouldn't download packages via APT, he was referring to APT-RPM on Fedora. The standard APT tools for use with .deb packages (for Debian and Debian-based distributions, rather than .rpm packages) are quite stable. It's just the RPM port that is reportedly kinda sketchy.

by charliespencer

I'm going to try defining the path as a new environmental variable. This has the advantage of letting me see the results of defining the variable without having to constatly edit the .repo's and rerun yum.

by jmgarvin

Set all your repos back to their original state and then try yum localinstall

That should do it. If not try my yum.conf

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
# Don't check keys for localinstall
gpgcheck=0
plugins=1
metadata_expire=1800
# Changed this because some mirrors go down and
# then re-trying takes forever.
timeout=7

by charliespencer

Same results with your yum.conf or mine.

[root@DT9068 ~]# yum localinstall /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm
Loading "installonlyn" plugin
Setting up Local Package Process
Examining /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm: gimp - 2:2.2.10-4.i386
Marking media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm to be installed
Setting up repositories
core [1/3]
Cannot find a valid baseurl for repo: core
Error: Cannot find a valid baseurl for repo: core

by jmgarvin

This is REALLY stupid...I hate yum so much...

Ok, so in your fedora.repo and fedora-update.repo change the baseurl path to /media/disk/Fedora/RPMS

You shouldn't have to do that using localinstall, but that's the only thing I can think of at this point...

by charliespencer

I am having fun with -MY- computer. The one at the house with WXP, Office 2003, Firefox, several games from PopCap, and WebSpinner, a site design GUI package I use to manage a very small fantasy NASCAR league.

My experiments with Linux are academic; I'm doing this only for the knowledge. My goal is to duplicate the functionality of my workplace desktop system as closely as possible (web, e-mail, office suite, access to shared network files and printers). One of the things I can do with my XP Pro box is install software from CDs and DVDs. I'm doing this at work on company time with the support of my supervisor. I also hope to learn things that would be useful if we have a disaster recovery problem and I need to assist with replicating the Linux servers at our other site onto hardware at this location.

Sure, popping chump change for another drive would solve the problem. It would be cheaper and faster to just swap drives with another computer I've got on the shelf. I could create copies of the DVDs on the HD and use them as repos. (Why would anyone take up drive space with installation files they may never use? Isn't that what the DVD's are for?) It would be even cheaper, faster, and more educational to revist the websites with the information on defining a proxy environmental variable. Then I could get past the company firewall and update from the mirror sites. That's what I'm going to do in the long run anyway, but that's not the point of the exercise. I'm trying to learn something here: can I install software from a DVD, preferably with yum since it's supposed to be the preferred tool for FC5 and I assume RHE, the standard distro where I work (run-on sentence, 5 points off). This strikes me as a very useful skill in a disater recovery context.

Since this isn't causing any downtime, home or work, some may want to walk away from this question. I'll understand people not wanting to work on an issue that doesn't have any long term impact.

by apotheon

I think jmgarvin is probably on the right track with using special YUM syntax, but a restored default YUM configuration. Now that he's mentioned it, I think I may remember doing something similar to that at one time.

Alas, I don't have a system available to me that runs YUM, so I don't have any reasonabe way to figure it out first-hand. Since jmgarvin is far more of a Red Hat guy than me, he's probably the guy to talk to anyway.

I, for one, don't mind working on a purely academic investigation like this. It stretches the mind.

by stress junkie

I didn't mean to upset you. Your post sounded very defensive. I figured you were using your computer at home. That's why I suggested purchasing hardware. It doesn't matter to me if you are also spending time in work learning tech skills with or without the consent of your supervisor.

I was just looking at the problem from a get-r-done point of view, and I didn't want you to become discouraged with Linux. I understand the appeal of an intellectual pursuit. That's why I have a machine running Gentoo Linux. Now THAT's a bugger to get working. I should say that it CAN be a bugger if you deliberately think of "advanced" things like encrypting the root partition on a software RAID configuration. (Just in case you're interested I can tell you that Gentoo is not any faster than SuSE, and probably not any faster than many other RPM based distributions. I mention it because people say that Gentoo is very fast relative to binary based distros. They're wrong.) I'm thinking of adding a FreeBSD machine to my collection to create a home theater machine including digital video recording (Tivo). So I understand the appeal of an intellectual pursuit. I also understand the frustration of being at the start of a learning curve when everything that you want to do requires research and experiments.

So that's what I was thinking when I suggested taking an alternate and possibly quicker approach.

:)

by jmgarvin

Fedora Core 3 was the best of the bunch, but yum is awful and there is a serious problem with how FC handles packages (they've even broken their RPM standard...jeez)

I still think Fedora is a good learning tool, however, I prefer Ubuntu or SuSe for the desktop.

by charliespencer

I didn't make the circumstances clear up front. I should have made it clear this wasn't a "real world" issue, but strictly a lab environment.

I'm really hoping to be able to post the solution on the other forums where I've asked this question. I can't be the only one who ordered this DVD set. I'll give this a few more days, then I'll write it off to experience, tweak the proxy settings and use the company broadband connection. At least I already know how to do that.

by charliespencer

RHE is the distro selected as our current corporate standard. I understand Fedora is the closest thing to that, and I was too lazy to complete the necessary purchasing paperwork for another RHE license :-)

While I'm trying to replicate the functionality of my XP desktop, I have no plans to replace it.

by charliespencer

"This is REALLY stupid...I hate yum so much..."

At this point, I'm not exactly shopping for engagement rings either :-) I'm only trying to get the repositories to work so I can get the GUI Add / Remove Software utilty to work from the CD's. I understand the utility called by that menu option uses the same repository settings as yum. I'm assuming fixing one will fix the other.

Regardless of our respective affections,

[root@DT9068 /]# yum localinstall /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpmLoading "installonlyn" plugin
Setting up Local Package Process
Examining /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm: gimp - 2:2.2.10-4.i386Marking /media/disk/Fedora/RPMS/gimp-2.2.10-4.i386.rpm to be installed
Setting up repositories
core [1/3]
file:///media/disk/Fedora/RPMS/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/media/disk/Fedora/RPMS/repodata/repomd.xml'
Trying other mirror.
Cannot open/read repomd.xml file for repository: core
failure: repodata/repomd.xml from core: [Errno 256] No more mirrors to try.
Error: failure: repodata/repomd.xml from core: [Errno 256] No more mirrors to try.

I thought the baseurl was supposed to point to the location of the repodata directory, which would be /media/disk.

Edited - See the post titled "Major Progress" above.

by charliespencer

"3. If that's the only thing in /media that starts with "Fedora", you could try specifying /media/Fedora*."

"It may be that when using YUM to access the repository on the DVDs, you just need to have the first DVD in the drive when you start and it'll tell you which DVD to put in when it needs a different one and handle it automaticaly. It may be worth a try."

The baseurl in the fedora-core, fedora-updates, and fedora-extras .repo files should be set to

baseurl=file:///media/disk

regardless of how the Updates and Extras DVDs mount themselves. This will allow access to the Core DVD, the one used for the original installation, either from yum or the Add / Remove Software GUI menu option. The localinstall option is not needed. The A / R app provides text descriptions of each package on the DVD so I know what they do, as I'd hoped.

Now to figure out what to do to access the other three DVDs. I tried removing the Core DVD and inserting one of the others. yum doesn't see the contents of the other DVD, and A / R displays only those apps from the Core DVD. I'm assuming there's a database of the all apps on the Core DVD, installed and uninstalled, and that both yum and A / R look at the database for available apps instead of looking at the current DVD.

by jmgarvin

To point to the other media. Does it have the repo xml file on it?

At least you are making progress!

by charliespencer

I'm abandoning this attempt. This was strictly for the knowledge so I'm going to configure the proxy server settings and use the web. While I am able to use yum and Add / Remove to access packages stored on the Core DVD, I am unable to use the Updates or Extras DVDs as repositories.

Apparently the Updates and Extras DVDs only have value as off-line package storage, and the only way to use the packages stored on them is to copy each package to a repository on the hard drive. This clearly makes dependencies a problem, since you don't know which ones you need to until after attempting an installation. At least the required support applications are on the other DVDs and can be copied to the local repo.

Is there any package manager, as installed with default settings, that will work with CDs and DVDs? Do they all require this level of configuration? I understand my experience with this project is limited to yum, but its given me two impressions: package managers are overrated, and Linux software can be easily installed only if you have broadband.

by apotheon

I've never had any problems using APT with Debian, and when installing Debian it gives you the option of setting it up to use the CDs as the primary package source.

I imagine there's a simple way to get the same effect with YUM for Fedora, but it seems prohibitively difficult to figure out how, to judge by your experience. Luckily, I'm not a Fedora guy.

by jmgarvin

The problem is fedora jerked it all up with yum and their add/remove programs. Yum it totally crippled and a horrible tool. apt-get in Fedora doesn't work well either.

If you want to see how package managers SHOULD work check out Ubuntu (Debian) or SuSe (apparently in 10.1 YaST is broken though)

I suppose you could manually go to the DVD and grab the rpms, but what's the point?

by stress junkie

I've been playing with Gentoo for about a year. Their package manager is called emerge. It seems reliable and I've used it a lot. You have to use emerge a lot when you use Gentoo. Installing Gentoo is like ordering a car by selecting each nut and bolt. (It doesn't really HAVE to be like that. They have an automatic kernel creation utility.) The only problem with Gentoo is that their system configuration method is unique so that your Gentoo expertise is not portable to other Linux or Unix systems. But if you want to have some fun then Gentoo rocks!!! And they have some of the best documentation of any Linux or Unix system and they have a huge portage tree of available tested applications.

by jmgarvin

For a long time you couldn't emerge firefox without jumping through hoops.

Sometimes emerge will do wierd things to if you setup your USE flags wrong.

All in all, not a bad way to do things though.

by jones

I know you went on but just for info here is the solution to your problem.

Edit /usr/share/hal/scripts/hal-system-storage-mount and find the following (line 81-91

...
if [ "$GIVEN_MOUNTPOINT" == "" ]; then
case "$HAL_PROP_VOLUME_LABEL" in
*[!A-Za-z0-9_:.+-]*)
;;
.*)
;;
*)
GIVEN_MOUNTPOINT="$HAL_PROP_VOLUME_LABEL"
esac
fi
...

Change to read:

...
if [ "$GIVEN_MOUNTPOINT" == "" ]; then
case "$HAL_PROP_VOLUME_LABEL" in
.*)
;;
*)
GIVEN_MOUNTPOINT="${HAL_PROP_VOLUME_LABEL//[!A-Za-z0-9_:.+-]/_}"
esac
fi
...

This change will cause HAL to mount using the volume label and replace all non valid characters with "_".

So now you can use the following under [core] in the /etc/yum.repos.d/fedora-core.repo file:

baseurl=file:///media/FC_5_i386/

If you want to use the Add/Remove Software application without a network connection, you need to disable all of the yum repositories. The enabled .repo files are core, updates, and extras. You can disable the updates and extras repositories by changing the line enabled=1 to enabled=0 in /etc/yum.repos.d/fedora-updates.repo and /etc/yum.repos.d/fedora-extras.repo.

You should be able to set up for the other 3 DVDs by building new .repo files or editing the ones already there. Be sure to change the enable=0 to enable=1 for the additional DVD's.

by stress junkie

I've never had any trouble with emerge except when it was unable to install ivtv drivers for my Hauppauge tv tuner. Yes you absolutely have to watch those USE flags. That's part of why it can take days to do something simple in Gentoo. Lots of research for every little thing. It can be fun though.

This discussion is closed to new replies.