yum proxy

Red Squirrel

No Lifer
May 24, 2003
69,311
13,048
126
www.anyf.ca
I was thinking, rather then going out online every time to install an app, is there such thing as a yum proxy server, where I point all my machines to that server as a repository, so when I do a yum install NNN it actually requests it to the proxy, if the proxy does not have that particular app, then it checks the real repositories, and then sends it down? This would be awesome for doing updates to many machines, or keeping local archive copies of software. In some cases the internet is not always available so it's nice to have a local copy of everything.

If yum does not have it, does apt have it? This is crucial especially if I decide to switch to linux for my desktop, as I like keeping local copies of all apps I install to be up and running asap in the even of having to reformat, or if a certain app becomes unavailable (ex: they go commercial and start charging).
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Just run a local repository. With aptitude it takes all of one command in your crontab and a few lines in a config file.

Code:
############# config ##################
#
  set base_path    /repo
#
# if you change the base path you must create the directories below with write privileges
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
set nthreads     20
set _tilde 0
#
############# end config ##############

deb http://mirror.anl.gov/ubuntu jaunty main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu jaunty-updates main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu jaunty-backports main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu jaunty-security main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu jaunty-proposed main restricted universe multiverse


deb http://mirror.anl.gov/ubuntu hardy main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu hardy-updates main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu hardy-backports main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu hardy-security main restricted universe multiverse
deb http://mirror.anl.gov/ubuntu hardy-proposed main restricted universe multiverse

deb-src http://mirror.anl.gov/ubuntu jaunty main restricted universe multiverse
deb-src http://mirror.anl.gov/ubuntu jaunty-updates main restricted universe multiverse
#deb-src http://mirror.anl.gov/ubuntu jaunty-backports main restricted universe multiverse
deb-src http://mirror.anl.gov/ubuntu jaunty-security main restricted universe multiverse
#deb-src http://mirror.anl.gov/ubuntu jaunty-proposed main restricted universe multiverse

clean http://mirror.anl.gov/ubuntu

Then all you have to do is run apt-mirror through cron however often you want to keep it updated.

For those sources listed above:

/dev/sdb1 99G 86G 7.8G 92&#37; /repo
 

Fallen Kell

Diamond Member
Oct 9, 1999
6,130
492
126
As has been stated already, run a local yum repository. Personally, I setup a repository on every system I configure with all the software contained on the installation media that I used. A lot of times these systems do not have internet connectivity, so at the very least, I can at always install a package that was available from the installation disks (which I know will be compatible with the rest of the versions of software already on the system).

It is pretty simple:

> cd /media/RHEL5_5.3\ x86_64\ DVD/Client (or whatever the path is to the install dvd)
> rpm -ihv createrepo-0.4.4-2.fc6.noarch.rpm
> cp -R /media/RHEL5_5.3 /<some dir to store all files>
> cd /<some dir to store all files>

> createrepo -vpo /<some path where repo data will be held> /<some dir to store all files>
> cd /<some path where repo data will be held>
> ln -s /<some dir to store all files>/Client Client
> ln -s /<some dir to store all files>/Workstation Workstation

Then create a file /etc/yum.repos.d/DVD.repo with the following content

[dvd]
name=RHEL5 DVD
baseurl=file:///<some path where repo data will be held>
enabled=1
gpgcheck=0

Run
> yum update

I personally like keeping my packages separate from the repo information, which is why the createrepo command puts it into a different directory...