Kusprayitna Blogs

Hidup untuk berbagi ilmu :: IT Linux Windows Database Oracle PHP OpenSource

Menikmati lokal repository CentOS

Posted by Prayitna Kuswidianta on July 29th, 2015

Menginstall repository secara lokal cukuplah mudah, sudah banyak cara di publis diinternet.

Berikut script yang didapat dari internet

## Point our log file to somewhere and setup our admin email
log=/var/log/mirrorcentos.log

adminmail=kusprayitna@uii.ac.id
# Set to 0 if you do not want to receive email
sendemail=1

# Subject is the subject of our email
subject="Centos Mirror Sync Finished"

## Setup the server to mirror
remote=mirror.smartmedia.net.id::centos

## Setup the local directory / Our mirror
local=/media/centos

## setup exclude
kecuali=/opt/mirror/centos.exclude

## Initialize some other variables
complete="false"
failures=0
status=1
pid=$$

 

echo "`date +%x-%R` - $pid - Started Centos Mirror Sync" >> $log
while [[ "$complete" != "true" ]]; do

if [[ $failures -gt 0 ]]; then
## Sleep for 5 minutes for sanity's sake
## The most common reason for a failure at this point
## is that the rsync server is handling too many concurrent connections.
sleep 5m
fi

if [[ $1 == "debug" ]]; then
echo "Working on attempt number $failures"
rsync -azH --delete-after --progress --exclude-from=$kecuali $remote $local
status=$?
else
rsync -azvH --delete-after --exclude-from=$kecuali $remote $local >> $log
status=$?
fi

if [[ $status -ne "0" ]]; then
complete="false"
(( failures += 1 ))
else

echo "`date +%x-%R` - $pid - Finished CentosĀ Mirror Sync" >> $log

# Send the email
if [[ -x /usr/bin/mail && "$sendemail" -eq "1" ]]; then
mail -s "$subject" "$adminmail" <<OUTMAIL
Summary of Centos Mirror Synchronization
PID: $pid
Failures: $failures
Finish Time: `date`

Sincerely,
$HOSTNAME

OUTMAIL
fi
complete="true"
fi
done

exit 0

 

Alhamdulillah telah selesai melakukan sinkronisasi

Untuk klien, diperlukan pengarahan secara langsung ke server lokal repository centos, sebab tidak didaftarkan ke public mirror centos

Untuk file /etc/yum.repos.d/CentOS-Base.repo isinya disesuaikan menjadi

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.uii.ac.id/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Saat dilakukan update dengan yum update maka di peroleh hasil saat download sebagai berikut :

Transaction Summary
==============================================================================================
Install 2 Package(s)
Upgrade 172 Package(s)

Total download size: 300 M
Is this ok [y/N]: y
Downloading Packages:
(1/174): crontabs-1.10-11.el5.noarch.rpm | 7.0 kB 00:00
(2/174): ius-release-1.0-14.ius.el5.noarch.rpm | 7.8 kB 00:00
(3/174): symlinks-1.2-26.el5.i386.rpm | 10 kB 00:00
(4/174): yum-plugin-replace-0.2.7-1.ius.el5.noarch.rpm | 17 kB 00:00
(5/174): irqbalance-0.55-16.el5_11.i386.rpm | 20 kB 00:00
(6/174): centos-release-5-11.el5.centos.i386.rpm | 21 kB 00:00
(7/174): yum-updatesd-0.9-6.el5_10.noarch.rpm | 23 kB 00:00
(8/174): device-mapper-event-1.02.67-2.el5_11.1.i386.rpm | 24 kB 00:00
(9/174): yum-metadata-parser-1.1.2-4.el5.i386.rpm | 26 kB 00:00
(10/174): cyrus-sasl-plain-2.1.22-7.el5_8.1.i386.rpm | 27 kB 00:00
(11/174): gdbm-1.8.0-28.el5.i386.rpm | 28 kB 00:00
(12/174): cpuspeed-1.2.1-11.el5_10.i386.rpm | 32 kB 00:00
(13/174): python-iniparse-0.2.3-6.el5.noarch.rpm | 34 kB 00:00
(14/174): php-ldap-5.1.6-45.el5_11.i386.rpm | 39 kB 00:00
(15/174): centos-release-notes-5.11-0.i386.rpm | 40 kB 00:00
(16/174): logrotate-3.7.4-14.i386.rpm | 42 kB 00:00
(17/174): libvolume_id-095-14.32.el5.i386.rpm | 45 kB 00:00
(18/174): iftop-1.0-0.7.pre4.el5.i386.rpm | 50 kB 00:00
(19/174): zlib-1.2.3-7.el5.i386.rpm | 51 kB 00:00
(20/174): ftp-0.17-38.el5.i386.rpm | 55 kB 00:00
(21/174): at-3.1.8-84.el5_11.1.i386.rpm | 56 kB 00:00
(22/174): php-imap-5.1.6-45.el5_11.i386.rpm | 57 kB 00:00
(23/174): telnet-0.17-41.el5.i386.rpm | 57 kB 00:00
(24/174): python-2.4.3-56.el5.i386.rpm | 60 kB 00:00
(25/174): psmisc-22.2-11.i386.rpm | 62 kB 00:00
(26/174): rpm-python-4.4.2.3-36.el5_11.i386.rpm | 62 kB 00:00
(27/174): php-pdo-5.1.6-45.el5_11.i386.rpm | 67 kB 00:00
(28/174): libgomp-4.4.7-1.el5.i386.rpm | 74 kB 00:00
(29/174): pm-utils-0.99.3-14.el5.i386.rpm | 75 kB 00:00
(30/174): popt-1.10.2.3-36.el5_11.i386.rpm | 77 kB 00:00
(31/174): expat-1.95.8-11.el5_8.i386.rpm | 78 kB 00:00
(32/174): dmidecode-2.12-1.el5.i386.rpm | 79 kB 00:00
(33/174): php-mysql-5.1.6-45.el5_11.i386.rpm | 88 kB 00:00
(34/174): libgcc-4.1.2-55.el5.i386.rpm | 97 kB 00:00
(35/174): php-xml-5.1.6-45.el5_11.i386.rpm | 99 kB 00:00
(36/174): rp-pppoe-3.5-33.el5.i386.rpm | 102 kB 00:00
(37/174): coolkey-1.1.0-17.el5.i386.rpm | 106 kB 00:00
(38/174): stunnel-4.15-2.el5.2.i386.rpm | 112 kB 00:00
(39/174): pcre-6.6-9.el5.i386.rpm | 118 kB 00:00
(40/174): php-gd-5.1.6-45.el5_11.i386.rpm | 119 kB 00:00
(41/174): e2fsprogs-libs-1.39-37.el5.i386.rpm | 120 kB 00:00
(42/174): cpio-2.6-26.el5.i386.rpm | 122 kB 00:00
(43/174): nspr-4.10.8-1.el5_11.i386.rpm | 124 kB 00:00
(44/174): dhcpv6-client-1.0.10-22.el5_11.i386.rpm | 124 kB 00:00
(45/174): dbus-libs-1.1.2-21.el5.i386.rpm | 125 kB 00:00
(46/174): cyrus-sasl-lib-2.1.22-7.el5_8.1.i386.rpm | 126 kB 00:00
(47/174): xinetd-2.3.14-20.el5_10.i386.rpm | 127 kB 00:00
(48/174): libjpeg-6b-38.i386.rpm | 138 kB 00:00
(49/174): man-pages-overrides-5.10.2-1.el5.noarch.rpm | 147 kB 00:00
(50/174): ccid-1.3.8-2.el5.i386.rpm | 148 kB 00:00
(51/174): php-common-5.1.6-45.el5_11.i386.rpm | 155 kB 00:00
(52/174): dbus-glib-0.73-11.el5_9.i386.rpm | 161 kB 00:00
(53/174): iptables-ipv6-1.3.5-9.2.el5_8.i386.rpm | 165 kB 00:00
(54/174): procmail-3.22-17.1.2.el5_10.i386.rpm | 167 kB 00:00
(55/174): sos-1.7-9.73.el5.centos.noarch.rpm | 169 kB 00:00
(56/174): bind-utils-9.3.6-25.P1.el5_11.2.i386.rpm | 174 kB 00:00
(57/174): nscd-2.5-123.el5_11.1.i386.rpm | 178 kB 00:00
(58/174): postgresql-libs-8.1.23-10.el5_10.i386.rpm | 198 kB 00:00
(59/174): cups-libs-1.3.7-32.el5_11.i386.rpm | 201 kB 00:00
(60/174): diffutils-2.8.1-16.el5.i386.rpm | 211 kB 00:00
(61/174): sqlite-3.3.6-7.i386.rpm | 213 kB 00:00
(62/174): procps-3.2.7-26.el5.i386.rpm | 214 kB 00:00
(63/174): mesa-libGLU-6.5.1-7.11.el5_9.i386.rpm | 226 kB 00:00
(64/174): curl-7.15.5-17.el5_9.i386.rpm | 235 kB 00:00
(65/174): dbus-1.1.2-21.el5.i386.rpm | 236 kB 00:00
(66/174): iptables-1.3.5-9.2.el5_8.i386.rpm | 238 kB 00:00
(67/174): kudzu-1.2.57.1.26-7.el5.centos.i386.rpm | 242 kB 00:00
(68/174): logwatch-7.3-10.el5.noarch.rpm | 245 kB 00:00
(69/174): libgcrypt-1.4.4-7.el5_10.i386.rpm | 251 kB 00:00
(70/174): wpa_supplicant-0.5.10-10.el5.i386.rpm | 259 kB 00:00
(71/174): man-1.6d-3.el5.i386.rpm | 262 kB 00:00
(72/174): dhclient-3.0.5-33.el5_9.i386.rpm | 281 kB 00:00
(73/174): openldap-2.3.43-28.el5_10.i386.rpm | 298 kB 00:00
(74/174): vim-minimal-7.0.109-7.2.el5.i386.rpm | 310 kB 00:00
(75/174): libtiff-3.8.2-19.el5_10.i386.rpm | 311 kB 00:00
(76/174): freetype-2.2.1-32.el5_9.1.i386.rpm | 313 kB 00:00
(77/174): file-4.17-28.i386.rpm | 319 kB 00:00
(78/174): rsync-3.0.6-6.el5_11.i386.rpm | 338 kB 00:00
(79/174): gnutls-1.4.1-16.el5_10.i386.rpm | 353 kB 00:00
(80/174): quota-3.13-8.el5.i386.rpm | 356 kB 00:00
(81/174): sudo-1.7.2p1-29.el5_10.i386.rpm | 357 kB 00:00
(82/174): net-tools-1.60-83.el5_10.i386.rpm | 361 kB 00:00
(83/174): libstdc++-4.1.2-55.el5.i386.rpm | 364 kB 00:00
(84/174): ipsec-tools-0.6.5-14.el5_8.5.i386.rpm | 383 kB 00:00
(85/174): hal-0.5.8.1-64.el5.i386.rpm | 396 kB 00:00
(86/174): nfs-utils-1.0.9-71.el5_11.i386.rpm | 403 kB 00:00
(87/174): libxslt-1.1.17-4.el5_8.3.i386.rpm | 420 kB 00:00
(88/174): module-init-tools-3.3-0.pre3.1.63.el5.i386.rpm | 432 kB 00:00
(89/174): selinux-policy-2.4.6-351.el5.noarch.rpm | 435 kB 00:00
(90/174): kpartx-0.4.7-63.el5.i386.rpm | 436 kB 00:00
(91/174): libuser-0.54.7-3.el5.i386.rpm | 441 kB 00:00
(92/174): hwdata-0.213.30-1.el5.noarch.rpm | 477 kB 00:00
(93/174): mkinitrd-5.1.19.6-82.el5.i386.rpm | 482 kB 00:00
(94/174): grub-0.97-13.11.el5_10.1.i386.rpm | 487 kB 00:00
(95/174): m2crypto-0.16-9.el5.i386.rpm | 495 kB 00:00
(96/174): smartmontools-5.42-2.el5.i386.rpm | 503 kB 00:00
(97/174): parted-1.8.1-30.el5.i386.rpm | 542 kB 00:00
(98/174): wget-1.11.4-3.el5_8.2.i386.rpm | 582 kB 00:00
(99/174): glibc-headers-2.5-123.el5_11.1.i386.rpm | 612 kB 00:00
(100/174): policycoreutils-1.33.12-14.13.el5.i386.rpm | 621 kB 00:00
(101/174): sendmail-8.13.8-10.el5_11.i386.rpm | 624 kB 00:00
(102/174): krb5-libs-1.6.1-80.el5_11.i386.rpm | 670 kB 00:00
(103/174): libxml2-python-2.6.26-2.1.25.el5_11.i386.rpm | 705 kB 00:00
(104/174): net-snmp-5.3.2.2-25.el5_11.i386.rpm | 705 kB 00:00
(105/174): tzdata-2015e-1.el5.i386.rpm | 742 kB 00:00
(106/174): tar-1.15.1-32.el5_8.i386.rpm | 748 kB 00:00
(107/174): nss_db-2.2-38.el5_11.i386.rpm | 759 kB 00:00
(108/174): nss-tools-3.18.0-6.el5_11.i386.rpm | 762 kB 00:00
(109/174): microcode_ctl-1.17-7.el5.i386.rpm | 774 kB 00:00
(110/174): libxml2-2.6.26-2.1.25.el5_11.i386.rpm | 799 kB 00:00
(111/174): device-mapper-1.02.67-2.el5_11.1.i386.rpm | 804 kB 00:00
(112/174): iproute-2.6.18-15.el5.i386.rpm | 814 kB 00:00
(113/174): e2fsprogs-1.39-37.el5.i386.rpm | 832 kB 00:00
(114/174): mdadm-2.6.9-5.el5.i386.rpm | 857 kB 00:00
(115/174): bind-libs-9.3.6-25.P1.el5_11.2.i386.rpm | 866 kB 00:00
(116/174): krb5-workstation-1.6.1-80.el5_11.i386.rpm | 890 kB 00:00
(117/174): autofs-5.0.1-0.rc2.184.el5.i386.rpm | 903 kB 00:00
(118/174): rpm-libs-4.4.2.3-36.el5_11.i386.rpm | 931 kB 00:00
(119/174): lftp-3.7.11-8.el5.i386.rpm | 932 kB 00:00
(120/174): aspell-0.60.3-13.i386.rpm | 946 kB 00:00
(121/174): pam-0.99.6.2-14.el5_11.i386.rpm | 983 kB 00:00
(122/174): php-mbstring-5.1.6-45.el5_11.i386.rpm | 997 kB 00:00
(123/174): yum-3.2.22-40.el5.centos.noarch.rpm | 1.0 MB 00:00
(124/174): elinks-0.11.1-8.el5_9.i386.rpm | 1.0 MB 00:00
(125/174): iscsi-initiator-utils-6.2.0.872-16.el5.i386.rpm | 1.0 MB 00:00
(126/174): shadow-utils-4.0.17-23.el5.i386.rpm | 1.0 MB 00:00
(127/174): nash-5.1.19.6-82.el5.i386.rpm | 1.1 MB 00:00
(128/174): mutt-1.4.2.2-6.el5.i386.rpm | 1.1 MB 00:00
(129/174): syslinux-4.02-7.2.el5.i386.rpm | 1.2 MB 00:00
(130/174): cyrus-sasl-2.1.22-7.el5_8.1.i386.rpm | 1.2 MB 00:00
(131/174): rpm-4.4.2.3-36.el5_11.i386.rpm | 1.2 MB 00:00
(132/174): httpd-2.2.3-91.el5.centos.i386.rpm | 1.2 MB 00:00
(133/174): ksh-20100621-24.el5_11.i386.rpm | 1.2 MB 00:00
(134/174): vim-enhanced-7.0.109-7.2.el5.i386.rpm | 1.2 MB 00:00
(135/174): nss-3.18.0-6.el5_11.i386.rpm | 1.3 MB 00:00
(136/174): net-snmp-libs-5.3.2.2-25.el5_11.i386.rpm | 1.3 MB 00:00
(137/174): tcl-8.4.13-6.el5.i386.rpm | 1.3 MB 00:00
(138/174): kbd-1.12-22.el5.i386.rpm | 1.3 MB 00:00
(139/174): ntp-4.2.2p1-18.el5.centos.i386.rpm | 1.3 MB 00:00
(140/174): selinux-policy-targeted-2.4.6-351.el5.noarch.rpm | 1.4 MB 00:00
(141/174): nss_ldap-253-52.el5_11.2.i386.rpm | 1.4 MB 00:00
(142/174): kernel-headers-2.6.18-406.el5.i386.rpm | 1.5 MB 00:00
(143/174): aspell-en-6.0-3.i386.rpm | 1.5 MB 00:00
(144/174): initscripts-8.45.45-1.el5.centos.i386.rpm | 1.6 MB 00:00
(145/174): openssl-0.9.8e-36.0.1.el5_11.i686.rpm | 1.7 MB 00:00
(146/174): clamav-0.98.7-1.el5.i386.rpm | 1.7 MB 00:00
(147/174): gawk-3.1.5-16.el5.i386.rpm | 1.7 MB 00:00
(148/174): bash-3.2-33.el5_11.4.i386.rpm | 1.8 MB 00:00
(149/174): gnupg-1.4.5-18.el5_10.1.i386.rpm | 1.8 MB 00:00
(150/174): util-linux-2.13-0.59.el5_8.i386.rpm | 1.9 MB 00:00
(151/174): system-config-network-tui-1.3.99.23-1.el5.noarch.rpm | 2.0 MB 00:00
(152/174): glibc-devel-2.5-123.el5_11.1.i386.rpm | 2.1 MB 00:00
(153/174): php-cli-5.1.6-45.el5_11.i386.rpm | 2.1 MB 00:00
(154/174): crash-5.1.8-3.el5.centos.i386.rpm | 2.2 MB 00:00
(155/174): php-5.1.6-45.el5_11.i386.rpm | 2.3 MB 00:00
(156/174): udev-095-14.32.el5.i386.rpm | 2.4 MB 00:00
(157/174): cpp-4.1.2-55.el5.i386.rpm | 2.7 MB 00:00
(158/174): libstdc++-devel-4.1.2-55.el5.i386.rpm | 2.8 MB 00:00
(159/174): device-mapper-multipath-0.4.7-63.el5.i386.rpm | 2.9 MB 00:00
(160/174): binutils-2.17.50.0.6-26.el5.i386.rpm | 3.0 MB 00:00
(161/174): lvm2-2.02.88-13.el5.i386.rpm | 3.2 MB 00:00
(162/174): gcc-c++-4.1.2-55.el5.i386.rpm | 3.4 MB 00:00
(163/174): gcc-4.1.2-55.el5.i386.rpm | 5.2 MB 00:00
(164/174): glibc-2.5-123.el5_11.1.i686.rpm | 5.4 MB 00:00
(165/174): python-libs-2.4.3-56.el5.i386.rpm | 5.9 MB 00:00
(166/174): kernel-devel-2.6.18-406.el5.i686.rpm | 5.9 MB 00:00
(167/174): specspo-13-4.el5.centos.noarch.rpm | 5.9 MB 00:00
(168/174): vim-common-7.0.109-7.2.el5.i386.rpm | 6.4 MB 00:00
(169/174): gtk2-2.10.4-30.el5.i386.rpm | 6.5 MB 00:00
(170/174): mesa-libGL-6.5.1-7.11.el5_9.i386.rpm | 9.6 MB 00:00
(171/174): perl-5.8.8-43.el5_11.i386.rpm | 12 MB 00:00
(172/174): glibc-common-2.5-123.el5_11.1.i386.rpm | 16 MB 00:01
(173/174): kernel-2.6.18-406.el5.i686.rpm | 20 MB 00:01
(174/174): clamav-db-0.98.7-1.el5.i386.rpm | 95 MB 00:07
----------------------------------------------------------------------------------------------
Total 11 MB/s | 300 MB 00:28
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded

Cukup memuaskan, download speed mencapai 11MB/s

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>