LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   How can I "keep" yum'ed RPMs so I can setup a new FC10 pc WITHOUT internet access? (https://www.linuxquestions.org/questions/fedora-35/how-can-i-keep-yumed-rpms-so-i-can-setup-a-new-fc10-pc-without-internet-access-695571/)

rylan76 01-07-2009 08:15 AM

How can I "keep" yum'ed RPMs so I can setup a new FC10 pc WITHOUT internet access?
 
Hi all

I'm currently using FC6, but considering going to FC10.

It seems that to do what I want, I'll -definitely- need to yum in quite a few packages once the basic FC10 is installed. (I want to put up the rpmfusion nvidia drivers for example, and get MP3 support among many other things).

I. e. once my new FC10 install is running, I -must- have a working internet connection to get all the .rpms I need from repositories.

HOWEVER

If I want to setup an FC10 system in a remote location where I will NOT have internet access (i. e. no live "yummable" access to repositories) how will I do it??

A perfect solution seems to be if I can somehow get yum to "keep" all the .rpm's and dependant rpm's it downloads in a "non-live" directory somewhere... the idea being if I have to install my other FC10 boxes somewhere where I do not have internet access, I can burn these "kept" .rpm's to disc and simply start rpm -ivh'ing them once the base FC10 install is done...

Is this possible? I'm not too worried about getting new updates etc. - I understand that doing it this way will "cut off" new systems from new versions of packages.

What's critical for me is to be able to have a disc with some .rpm's with all dependencies fixed up (via yum) but NOT have to connect to repositories for each new FC10 system I set up - I want a "local" set of .rpm's with all solved dependencies already at hand.

Can yum do this? Or is there some way to "defer" yum from "actioning" (for want of a better word) just-downloaded .rpm's? So I can keep them and burn them to disc with all their dependencies readily available?

What would an rpm commandline look like that will behave "yum-like" in that it will install a package, and automatically first install all dependencies, given a directory with all the fully "yummed" .rpm's in it?

alan_ri 01-07-2009 08:47 AM

Add your / where rpms already are to /etc/yum.repos.d,then run yum install somefile*.

rylan76 01-07-2009 12:46 PM

Quote:

Originally Posted by alan_ri (Post 3399885)
Add your / where rpms already are to /etc/yum.repos.d,then run yum install somefile*.

Thanks! If I understand you correctly, I need to just add, for example

/home/myhome/yum_rpms

to

/etc/yum.repos.d

and this will make yum put all downloaded .rpms into /home/myhome/yum_rpms?

Or do you mean I need to do the above AFTER I have all the .rpms obtained by some other mechanism, that I otherwise would have had to pull through an internet connection?

lazlow 01-07-2009 12:58 PM

You want to have a look at the createrepo package. It allows you to create your own repo (local or otherwise).

Since it seems you run a machine for long periods without upgrading, you may want to consider Centos. Centos is RHEL with the logos removed. It is free to download/update and is binary compatible with RHEL. RHEL/Centos5 was based on FC6, so you would be very much at home with it. RHEL/Centos has a 5year support life as compared to Fedora's 13month support life.

alan_ri 01-07-2009 01:18 PM

Quote:

Originally Posted by rylan76 (Post 3400161)
Thanks! If I understand you correctly, I need to just add, for example

/home/myhome/yum_rpms

to

/etc/yum.repos.d

and this will make yum put all downloaded .rpms into /home/myhome/yum_rpms?

Or do you mean I need to do the above AFTER I have all the .rpms obtained by some other mechanism, that I otherwise would have had to pull through an internet connection?

No,no,no,you got to understand that rpms are on the one machine and you want to install them on the other.I was thinking that you have a LAN with 2 machines and you want to install some packages from one to the other without internet connection,if so,you can do that but you can't put the path /home/something,it has to be a full path to the other machine;for example; ftp://192.168.1.2/ where the / is your entire root directory,because that's the best way to do it,since it would be very hard for you to look where are all the files you need,it's better if yum do it.If you can't do it that way then CD is an answer,first copy all the files you want to it and then mount it on the machine you want and add it as a repo to your /etc/yum.repos.d and then just install any package you want with the command I've told you before and in that command * is very important because it will install all the dependencies that a program requiers.

rylan76 01-08-2009 12:31 AM

Hi all

I took a look at createrepo, as well as, to whit

http://dotancohen.com/howto/yum_repo.html

However, this seems to imply that I'll need to download the entire update repository. Also, it does not address the fact that this will only work with a Fedora rsync'ed update site, while I specifically want to create a local repository of very specific non-Fedora stuff - i.e. to do non-Fedora work (play MP3's, codec rpm's etc) on newly installed FC10 systems that do not have internet connections.

I just want a local copy kept of rpm files yum downloads during very specific packages' installation... so that later I can edit the yum config file as other posters have already explained to me, and have yum pull those SPECIFIC .rpm files from the local filesystem.

I. e. some way to capture all the -specific- .rpm's yum downloads as it runs, keep them locally, and then later direct yum to them for the same update.

Thanks!

EDIT: I found this at http://www.phy.duke.edu/~rgb/General..._HOWTO-11.html

Code:

# yum install package1 [package2 package3...]

Yum checks to see if package1 is already installed and is the latest version. If not, it downloads package1 {\em and all its dependency packages} (saving them in its cache directory) and installs them. Additional packages can be listed on the same command line. The packages can be specified with standard filesystem globs. Some examples:

I. e. if I just simply write this cache directory to a CD / DVD, I'll be sitting pretty?

I. e. for subesquent installs, just copy this cache directory back from disc, then yum will be short-circuited to pull updates from its cache INSTEAD of the internet repositories??

Is this assumption correct?

alan_ri 01-08-2009 05:38 AM

Quote:

Originally Posted by rylan76 (Post 3400725)
Is this assumption correct?

It is.

billymayday 01-08-2009 06:30 AM

You should check /etc/yum.conf to make sure that "keepcache=1" and not 0, otherwise you won't have any rpms in the cache.

dannybpng 01-08-2009 07:07 PM

billymayday response is a way to do it. The packages are then cached in folders under:

/var/cache/yum/

and the repository name. You can copy them from there to the other machines, but you will need to then know the dependencies and install those files too. I did that for a while while our Internet connection was too expensive, but that has changed and I am relieved.

billymayday 01-08-2009 10:01 PM

Quote:

Originally Posted by dannybpng (Post 3401736)
billymayday response is a way to do it. The packages are then cached in folders under:

/var/cache/yum/

and the repository name. You can copy them from there to the other machines, but you will need to then know the dependencies and install those files too. I did that for a while while our Internet connection was too expensive, but that has changed and I am relieved.

Don't the dependencies get cached as well if they are installed by yum?

dannybpng 01-09-2009 01:44 AM

The RPMs are cached and the dependencies are inside the RPMs but my understanding is that if you just copy the RPM files over to another machine you have to know which files are needed by which RPM to put them all on the same rpm command line statement. The rpm program will tell you what is missing. If your working with a small amount of files then this is manageable. My understanding is that the repo data XML connects the pieces for yum to use. Correct me if I'm wrong.

rylan76 01-09-2009 06:44 AM

Hi guys thanks for all the respones.

Yes, that is my concern too - one of the reasons I tried to avoid RPM up to now was that I have always had immense problems with a certain .rpm requiring zillions of dependencies, then each of those dependant .rpm's has got its own, each of them have their own, etc. ad infinitum.

I. e. the whole idea behind keeping the yum cache is exactly this - to avoid having to install all those dependant .rpm's by hand.

Does the yum .rpm cache cache the concomitant yum .xml as well (which, as I gather, contains the dependancy information?)

I. e. so I can just install a yum package from local storage, and have that package automatically install its depencies first, just as yum behaves when it pulls packages from an online repository? I guess this will be where createrepo will come in?

rylan76 01-09-2009 06:46 AM

Quote:

Originally Posted by dannybpng (Post 3402004)
The RPMs are cached and the dependencies are inside the RPMs but my understanding is that if you just copy the RPM files over to another machine you have to know which files are needed by which RPM to put them all on the same rpm command line statement. The rpm program will tell you what is missing. If your working with a small amount of files then this is manageable. My understanding is that the repo data XML connects the pieces for yum to use. Correct me if I'm wrong.

Hmm - but if I copy the -entire- yum cache directory, won't this include the needed XML too? Instead of just the .RPMs in the cache folder, copy the whole shebang to DVD or whatever, then later copy it back and presto, a local, offline repository?

billymayday 01-09-2009 01:36 PM

It won't include the xml, but install the "creeaterepo" package to generate it.

repomd.xml is like a package list for what's in the repo. The dependencies are listed in the rpm itself. I would assume that dependencies will be cached, and using yum rather than rpm to install a package will sort that issue.

Haven't tried this though.

lazlow 01-09-2009 02:31 PM

Which is why I mentioned createrepo earlier in the thread.

When you install locally, look at using yum localinstall rather than using the rpm command.


All times are GMT -5. The time now is 07:11 PM.