DrLove73 |
09-19-2009 03:22 AM |
Quote:
Originally Posted by saifkhan123
(Post 3689392)
well, you can set up local update server for all of your machines, just see my blog at
http://net-warrior.blogspot.com
this tutorial is for CentOS 5.x, but it can work for you with some changes which u need to sort out.
|
Your manual is nicely written, but it's too much manual labor. There is "mrepo" package in EPEL repository. Setting it up is very easy.All you need is to setup 2 config files:
/etc/mrepo.conf.d/*.conf (like centos5.conf for all repos at one place like me, or separate files for each group of repositories).
My /etc/mrepo.conf.d/centos5.conf:
Code:
### Name: The Community Enterprise Operating System v5
### URL: http://www.centos.org/
[centos5]
name = CentOS $release ($arch)
release = 5
#arch = i386 x86_64 ia64 ppc s390 s390x alpha
arch = i386
metadata = apt repomd repoview yum
# rsync --list-only rsync://host/ # Command for controling available repo's
# and for inside add next folder and "/" like:
# rsync --list-only rsync://host/linux/ # Command for controling available repo's
### ISO images
#iso = CentOS-5.3-$arch-bin-DVD.iso
#os = http://mirrors.kernel.org/centos/$release/os/$arch/CentOS/
os = rsync://ftp.freepark.org/linux/centos/$release/os/$arch/CentOS/
##### Images
###images = mrepo://images/
### Additional repositories
updates = rsync://ftp.freepark.org/linux/centos/$release/updates/$arch/RPMS/
#fasttrack = http://mirrors.kernel.org/centos/$release/fasttrack/$arch/RPMS/
centosplus = rsync://ftp.freepark.org/linux/centos/$release/centosplus/$arch/RPMS/
#contrib = rsync://ftp.freepark.org/linux/centos/$release/contrib/$arch/RPMS/
extras = rsync://ftp.freepark.org/linux/centos/$release/extras/$arch/RPMS/
addons = rsync://ftp.freepark.org/linux/centos/$release/addons/$arch/RPMS/
### EPEL repository
epel = rsync://rsync.hrz.tu-chemnitz.de/fedora-epel/$release/$arch/
epel-testing = rsync://rsync.hrz.tu-chemnitz.de/fedora-epel/testing/$release/$arch/
### Virtualmin
virtualmin-universal = http://software.virtualmin.com/gpl/universal/
virtualmin = http://software.virtualmin.com/gpl/rhel/$release/$arch/
### ATrpms repository
##atrpms-stable = http://dl.atrpms.net/el5-$arch/atrpms/stable/
atrpms-stable = rsync://rsync.hrz.tu-chemnitz.de/ftp/pub/linux/ATrpms/el5-$arch/atrpms/stable/
##atrpms-testing = http://dl.atrpms.net/el5-$arch/atrpms/testing/
atrpms-testing = rsync://rsync.hrz.tu-chemnitz.de/ftp/pub/linux/ATrpms/el5-$arch/atrpms/testing/
###### RPMforge repository
rpmforge = rsync://apt.sw.be/pub/freshrpms/pub/dag/redhat/el5/en/$arch/RPMS.dag/
####rpmforge = ftp://apt.sw.be/pub/dag/pub/redhat/el5/en/$arch/RPMS.dag/
####rpmforge = http://apt.sw.be/redhat/el5/en/$arch/RPMS.dag/
### Livna repository
##livna = http://livna-dl.reloumirrors.net/fedora/6/i386/
##livna-devel = http://livna-dl.reloumirrors.net/fedora/development/i386/
### kbsingh-CentOS-Extras
kb-el5-ext-test = http://centos.karan.org/el5/extras/testing/i386/RPMS/
kb-el5-ext = http://centos.karan.org/el5/extras/stable/i386/RPMS/
### kbsingh-CentOS-Misc
kb-el5-misc-test = http://centos.karan.org/el5/misc/testing/i386/RPMS/
kb-el5-ext = http://centos.karan.org/el5/misc/stable/i386/RPMS/
### OpenVZ repositories
##ovzkernel = http://download.openvz.org/kernel/rhel5/
##ovztemplate = http://download.openvz.org/template/
##ovzutils = http://download.openvz.org/utils/
### PostgreSQL repository
##postgresql = ftp://ftp.fr.postgresql.org/binary/v8.1.4/linux/rpms/redhat/rhel-as-$release-$arch/
#### Custom repository for your own RPM packages
# My compiled rpm's
custom =
Second file is my /etc/mrepo.conf (with (almost) all possible settings):
Code:
### Configuration file for mrepo
### The [main] section allows to override mrepo's default settings
### Main section defines paths, commands
### and what metadata to generate
### The mrepo-example.conf gives an overview of all the possible settings
### These options show you the hardcoded defaults
### You can leave them out if this is what you want
[main]
srcdir = /var/mrepo
wwwdir = /var/www/mrepo
# or:
#wwwdir = /home/plnet/domains/centos.<your-domain>/public_html/mrepo
confdir = /etc/mrepo.conf.d
arch = i386 # I only use i386, add yours
mailto = office@<your-domain>
smtp-server = localhost # Or your SMTP gateway
#rhnlogin = username:password
### Any other section is considered a definition for a distribution
### You can put distribution sections in /etc/mrepo.conf.d/
### Examples can be found in the documentation at:
### /usr/share/doc/mrepo-0.8.4/dists/.
#hardlink = yes
#shareiso = no
rsync-timeout = 3600
rsync-bandwidth-limit = 400
#rsync-bandwidth-limit = 125
#rsync-bandwidth-limit = 32
## Default architecture is i386
#arch = i386
## The location of the example .shtml files
#htmldir = /usr/share/mrepo/html
## The location of the ISO images and RPM files
#srcdir = /var/mrepo
## The location of the generated repositories
#wwwdir = /var/www/mrepo
## The location of the dist config files
#confdir = /etc/mrepo.conf.d
## The location of the cachedir (used by yum)
#cachedir = /var/cache/mrepo
## The location of the lockdir
#lockdir = /var/cache/mrepo
## The location of the (latest) pxelinux bootcode
#pxelinux = /usr/lib/syslinux/pxelinux.0
## The location of the Yam TFTP files
#tftpdir = /tftpboot/mrepo
## The location of the logfile
logfile = /var/log/mrepo.log
## The location of the different executables
#createrepocmd = /usr/bin/createrepo
#genbasedircmd = /usr/bin/genbasedir
#hardlinkcmd = /usr/sbin/hardlink
#hardlinkpluscmd = /usr/bin/hardlink++
#lftpcmd = /usr/bin/lftp
#mirrordircmd = /usr/bin/mirrordir
#mountcmd = /bin/mount
#repoviewcmd = /usr/bin/repoview
#rhngetcmd = /usr/bin/rhnget
#rsynccmd = /usr/bin/rsync
#umountcmd = /bin/umount
#yumarchcmd = /usr/bin/yum-arch
## What repository metadata do you want to generate ?
#metadata = apt repomd yum
#metadata = repomd
## Your username and password for RHN channel subscriptions
#rhnlogin = username:password
#rhnlogin =
## Specify the required proxy settings
#no_proxy = localhost,mrepo,webserver
#ftp_proxy = http://10.1.2.3:8080
#http_proxy = http://10.1.2.3:8080
#https_proxy = http://10.1.2.3:8080
#no_proxy =
#ftp_proxy =
#http_proxy =
#https_proxy =
## You can have mrepo send out report mails
# mailto = user@domain.com user2@domain2.com
#mailto =
#mailfrom = mrepo@hostname
#smtp-server = localhost
## Default output (put this to yes if you want mrepo to be silent by default)
#quiet = no
## Hardlink files in the srcdir before ending Yam
#hardlink = no
## Do you want to share the ISO files in wwwdir ?
#shareiso = yes
## Limit the bandwidth used by lftp (in B/secs)
lftp-bandwidth-limit = 170000
## Clean up packages that are not on the sending side ?
lftp-cleanup = yes
## Exclude debuginfo or source packages ?
#lftp-exclude-debug = yes
#lftp-exclude-srpm = yes
## Add extra options to lftp (eg. -d for debugging lftp)
#lftp-options = -d
## Add extra commands to lftp (eg. set dns:fatal-timeout 5)
#lftp-commands =
## Add extra options to lftp mirror command
#lftp-mirror-options = -c -P -e --delete-first
## Set the I/O timeout in seconds
lftp-timeout = 3600
## Clean up packages that are not on the sending side ?
#mirrordir-cleanup = yes
## Exclude debuginfo or source packages ?
#mirrordir-exclude-debug = yes
#mirrordir-exclude-srpm = yes
## Add extra options to mirrordir
#mirrordir-options =
## Set RHN login username:password
#rhnlogin =
## Add extra options to rhnget
#rhnget-options =
## Clean up packages that are not on the sending side ?
#rhnget-cleanup = yes
## Download older versions of a certain package ?
#rhnget-download-all = no
## Limit the bandwidth used by rsync in kilobytes per seconds
#rsync-bandwidth-limit =
## Clean up packages that are not on the sending side ?
#rsync-cleanup = yes
## Exclude debuginfo or source packages ?
#rsync-exclude-debug = yes
#rsync-exclude-srpm = yes
## Add extra options to rsync
#rsync-options = -rtHL --partial
## Set the I/O timeout in seconds
#rsync-timeout =
## Add extra options to createrepo
#createrepo-options = -p
## Add extra options to repoview
#repoview-options =
To run mrepo daily, delete coment from line in /etc/cron.d/mrepo (I think it exists), or create your own crone job.
You also have to make a softlilnk in your website's folder to /var/www/mrepo folder (if you chosen to not change wwwdir) and I also created softlink in srcdir to folder on external partition because my repo's are around 20 GB of files.
All you now need is *.repo file for clients. My "/etc/yum.repos.d/CentOS-PLC-mrepo.repo" looks like this:
Code:
[PLC-os]
name=Spec CentOS 5 - os - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.os/
gpgcheck=0
enabled=1
[PLC-updates]
name=Spec CentOS 5 - updates - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.updates/
gpgcheck=0
enabled=1
[PLC-extras]
name=Spec CentOS 5 - extras - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.extras/
gpgcheck=0
enabled=1
[PLC-centosplus]
name=Spec CentOS 5 - centosplus - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.centosplus/
gpgcheck=0
enabled=1
[PLC-rpmforge]
name=Spec CentOS 5 - rpmforge - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.rpmforge/
gpgcheck=0
enabled=0
[PLC-atrpms-stable]
name=Spec CentOS 5 - atrpms-stable - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.atrpms-stable/
gpgcheck=0
enabled=1
[atrpms-testing]
name=Spec CentOS 5 - atrpms-testing - $releasever - $basearch
baseurl=http://dl.atrpms.net/el5-i386/atrpms/testing/
gpgcheck=0
enabled=0
[PLC-custom]
name=Spec CentOS 5 - custom - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.custom/
gpgcheck=0
enabled=0
[PLC-virtualmin]
name=Spec CentOS 5 - virtualmin - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.virtualmin/
gpgcheck=0
enabled=0
[PLC-virtualmin-universal]
name=Spec CentOS 5 - virtualmin-universal - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.virtualmin-universal/
gpgcheck=0
enabled=0
[PLC-kb-el5-ext-test]
name=Spec CentOS 5 - kb-el5-ext-test - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.kb-el5-ext-test/
gpgcheck=0
enabled=0
[PLC-kb-el5-misc-test]
name=Spec CentOS 5 - kb-el5-misc-test - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.kb-el5-misc-test/
gpgcheck=0
enabled=0
[PLC-epel]
name=Spec CentOS 5 - epel - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.epel/
gpgcheck=0
enabled=1
[PLC-epel-testing]
name=Spec CentOS 5 - epel-testing - $releasever - $basearch
baseurl=http://centos.<your-domain>/mrepo/centos5-i386/RPMS.epel-testing/
gpgcheck=0
enabled=0
[pidgin]
name=Pidgin for RHEL/CentOS $releasever - $basearch
baseurl=http://rpm.pidgin.im/centos/$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://rpm.pidgin.im/RPM-GPG-KEY-pidgin
[adobe-linux-i386]
name=Adobe Systems Incorporated
baseurl=http://linuxdownload.adobe.com/linux/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
And that should be it. use "mrepo -uvvv" to download all files to srcdir, "mrepo -gvvv" if you add your own rpm's in "custom" folder, or "mrepo -ugvvv" to both download new files and recreate mrepo links and generate required repo files.
|