LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   how can i add a local Folder on local Hard Disk as Yum Repository ?? (https://www.linuxquestions.org/questions/fedora-35/how-can-i-add-a-local-folder-on-local-hard-disk-as-yum-repository-530387/)

vahid_p 02-19-2007 07:44 AM

how can i add a local Folder on local Hard Disk as Yum Repository ??
 
hi frinds ,

i have FC6 and for installing new package with yum , it get this package from internet .

i create a Folder in /root/Desktop/CD and copy all files in it .

how can i add this folder to yum repository , because i want yum install new package from this location not intarnet .

Vary Thanks

colucix 02-19-2007 08:06 AM

You have to simply add the following entry in /etc/yum.repos.d/fedora-core.repo or create it if you don't have this file on your system:
Code:

[Local-Install]
name=Fedora Core $releasever - $basearch
baseurl=file:///root/Desktop/CD/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY


v00d00101 02-19-2007 09:30 AM

Think about rsync as well for keeping it up to date.

I do similar due to having 3 machines running fedora, it consumes less bandwidth to rsync an update mirror, than for every machine to update on its own. The downside is the amount of space required (currently about 10GB on my ftp server.

stormtracknole 02-22-2007 08:55 AM

Quote:

Originally Posted by v00d00101
Think about rsync as well for keeping it up to date.

I do similar due to having 3 machines running fedora, it consumes less bandwidth to rsync an update mirror, than for every machine to update on its own. The downside is the amount of space required (currently about 10GB on my ftp server.

Or,you could use try using nfs to mount your /var/cache/yum directory to your other machines. That's what I do at home with my two fedora boxes. One will be the main server and I update that one first. After that one is done, the other machine does not have to download any files since it's already located in the server and I have mounted the yum directory on the second machine. Works well. I have never tried out rsync though. That is also a good way to do things.

wmakowski 02-22-2007 10:43 AM

I agree with what the others have said, but also recommend checking out the createrepo command/package. It will create the repo metadata based on the rpms in the local directory. Placing this repository under /root is probably not the best idea. My preference would be to place it under /usr/local.

For example someone may not have access to the internet and want to copy all the RPMS from the installation CDs into a directory. Once that is completed you would follow up with createrepo and then adjust your configuration file under /etc/yum.repos.d. Creating the metadata and a cache will decrease your processing time on subsequent runs. It will be very easy to use yum to add packages rather than going through the CDs.

Bill


All times are GMT -5. The time now is 12:32 PM.