How to use YUM to localy update FC6

Stephen Croll scroll at airmail.net
Thu Dec 14 08:14:59 UTC 2006


Matthew Miller wrote:
> On Mon, Dec 04, 2006 at 06:09:03PM +0100, Erik Grootjans wrote:
>   
>> I have a small network with 3 computers.
>> I want to download the updates only once - using yum or some other
>> program.
>> Yum has to update the local computer, but must not delete the updates
>>     
>
> Use rsync to put the updates on a local ftp or nfs server, and then
> configure that as the yum repository on the other machines -- look in
> /etc/yum.repos.d/.
>   
Another option is to configure squid on one of the computers. Through
trial and error I managed to get squid and yum to work. As far as I
can tell, you'll need to disable caching of the non-rpm files and
you'll always need to use the same repository server for each
repository. Please note, I am no expert at this, but the following
are the changes I made in my (FC5) /etc/squid/squid.conf file. The
comment lines give an indication in what section I inserted the
changes.

# TAG: no_cache
acl YUM_FILELISTS urlpath_regex repodata/filelists.xml.gz$
no_cache deny YUM_FILELISTS

acl YUM_PRIMARY urlpath_regex repodata/primary.xml.gz$
no_cache deny YUM_PRIMARY

acl YUM_REPOMD urlpath_regex repodata/repomd.xml$
no_cache deny YUM_REPOMD

acl PURGE method PURGE
acl localhost src 127.0.0.1
http_access allow PURGE localhost
http_access deny PURGE


# TAG: cache_mem (bytes)
cache_mem 64 MB


# TAG: maximum_object_size (bytes)
maximum_object_size 100 MB


# TAG: cache_dir
cache_dir ufs /usr/local/squid 51200 16 256


# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl our_networks src 192.168.1.0/24
http_access allow our_networks


Then on each box (including the one running squid), I modified the
/etc/yum.conf file and added the address of my proxy:

proxy=http://192.168.1.2:3128

Finally, for each box and each repository, I configured a mirror. In
general, I commented out the mirrorlist, and added a baseurl with my
favorite mirror. I also ensured that I had the correct path on that
particular mirror. For example:

[updates]
name=Fedora Core $releasever - $basearch - Updates

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/ 


#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever 


baseurl=http://ADD.YOUR.FAVORITE.MIRROR.HERE.ORG/fedora/core/updates/$releasever/$basearch/ 

enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

For apt users, there is some sort of apt proxy. If such a thing
exists for yum, that may be a better choice.

-- Steve Croll




More information about the fedora-list mailing list