CentOS local yum source construction

Source: Internet
Author: User

CentOS local yum source construction

Step 1:

From the yum source of rsync, the synchronization script is as follows:

[Root @ 50-250 crontab] # cat yum_update.sh
#! /Bin/bash
Date = 'date + % F'
Echo $ date>/var/log/yum_update.log
######### Centos
Sour_URL = "rsync: // centos.ustc.edu.cn/centos"
OsList = "6.6"
OS _Plant = "x86_64"
Cmd = "rsync-avrt"
Cmd =$ {cmd }$ {sour_URL} "/" $ {sour_Dir }"/"
OutDir = "/home/himalayas/yum/centos/6/" ### if change, please notice the line of epel, rpmforge, rpmfusion
For yumdir in OS updates extras centosplus contrib;
Do
Test-d $ outDir/$ yumdir | mkdir-p $ outDir/$ yumdir
Rsync-avrt $ sour_URL/$ osList/$ yumdir/$ OS _Plant $ outDir/$ yumdir>/var/log/yum_update.log &
Done

######### Epel
Test-d/home/himalayas/yum/epel/6/x86_64 | mkdir-p/home/himalayas/yum/epel/6/x86_64
Rsync-avrt -- exclude = debug/-- exclude = repoview/rsync: // logs/home/himalayas/yum/epel/6/x86_64>/var/log/yum_update.log &

######### Rpmforge
Test-d/home/himalayas/yum/rpmforge/6/rpmforge/x86_64 | mkdir-p/home/himalayas/yum/rpmforge/6/rpmforge/x86_64
Test-d/home/himalayas/yum/rpmforge/6/extras/x86_64 | mkdir-p/home/himalayas/yum/rpmforge/6/extras/x86_64
Rsync-avrt rsync: // mirror. cpsc. ucalgary. ca/dag/redhat/el6/en/x86_64/rpmforge // home/himalayas/yum/rpmforge/6/rpmforge/x86_64>/var/log/yum_update.log &### 4678
Rsync-avrt rsync: // mirror. cpsc. ucalgary. ca/dag/redhat/el6/en/x86_64/extras/home/himalayas/yum/rpmforge/6/extras/x86_64>/var/log/yum_update.log &

######### Rpmfusion
Test-d/home/himalayas/yum/rpmfusion/free/x86_64 | mkdir-p/home/himalayas/yum/rpmfusion/free/x86_64
Test-d/home/himalayas/yum/rpmfusion/nofree/x86_64 | mkdir-p/home/himalayas/yum/rpmfusion/nofree/x86_64
Rsync-avrt rsync: // logs/home/himalayas/yum/rpmfusion/free/x86_64>/var/log/yum_update.log &

Rsync-avrt rsync: // logs/home/himalayas/yum/rpmfusion/nofree/x86_64>/var/log/yum_update.log &

Note:

1. Visit this Website: centos.ustc.edu.cn/centos/. After the version is updated, all rpm packages may be transferred from 6.5 to the 6.6 directory. In this case, manually change the variable: osList = "6.6 ", then it is best to manually execute it once to see if updates can be synchronized.

2. You can run the following command to view the directory structure of the Peer rsync source and all rpm packages.

Rsync-avrt rsync: // centos.ustc.edu.cn/centos/6.6/ OS /x86_64

Step 2: add to crontab to synchronize once a day

00 00 ***/bin/bash/kuxun/crontab/yum_update.sh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.