Facebook Twitter Gplus RSS
 
 
Home » CentOS 5.4 Tutorials » Adding CentOS 5.4 to local YUM Repository
formats

Adding CentOS 5.4 to local YUM Repository

Published on October 14th, 2009

centos
What is CentOS?

CentOS is 100% compatible rebuild of the Red Hat Enterprise Linux, in full compliance with Red Hat’s redistribution requirements. CentOS is for people who need an enterprise class operating system stability without the cost of certification and support.

Following the release of RHEL 5.4, CentOS 5.4 has just hit the CentOS mirrors. Time to update the Local CentOS YUM repository script.

Adding CentOS 5.4 to the YUM repository script

Create the following additional Directories for CentOS 5.4:

# mkdir -p /var/www/html/centos/5.4/os/i386
# mkdir -p /var/www/html/centos/5.4/updates/i386
# mkdir -p /var/www/html/centos/5.4/os/x86_64
# mkdir -p /var/www/html/centos/5.4/updates/x86_64

Add the CentOS 5.4 repository to the bash script which will rsync your local YUM repository server with a CentOS 5.4 YUM mirror.

CentOS Mirror list – http://www.centos.org/modules/tinycontent/index.php?id=30

# vi yum-repo-update.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
 
rsync="rsync -avrt --bwlimit=256"
 
mirror=ftp.is.co.za::IS-Mirror/centos
 
verlist="5.3 5.4"
archlist="i386 x86_64"
baselist="os updates"
local=/var/www/html/centos/
 
for ver in $verlist
do
 for arch in $archlist
 do
  for base in $baselist
  do
    remote=$mirror/$ver/$base/$arch/
    $rsync $remote $local/$ver/$base/$arch/
  done
 done
done

NB! Please read creating a Local CentOS YUM repository on CentOS 5.x before implementing.

Upgrading from CentOS 5.3 ( or CentOS 5.0 / 5.1 / 5.2 ):

If you are already running CentOS 5.3 or an older CentOS 5 distro, all you need to do is update your machine via yum by running :

# yum update

 
  • http://blog.burlock.org nburlock

    I could have used your PHP installation guide a couple of weeks ago when I was learning how to administer a CentOS server from the command line…

    I was wondering, the search box is giving full posts as results, but only a few per page. Is there any way to see some sort of index, more results with a tally, “x of y results”? That sort of thing? It'd make it easier to browse the site.

    Also, your tag cloud widget is looking a bit bare – it needs more tags! :)

  • How2CentOS

    Never tried the search functionality, but you're right, it's shocking! Added Google Ajax search which is pretty cool, give it a try?

    :-) The tag cloud, well, in an attempt to get Categories displayed as pages broke it but it will be up and running soon.

    Thanks for your feedback, alway appreciated!

  • http://mymcp.blogspot.com Steve Lippert

    Instead of running each mkdir command like you do you can run just one command:
    # mkdir -pv 5.4/{os,updates}/{i386,x86_64}

    Which outputs:

    mkdir: created directory `5.4'
    mkdir: created directory `5.4/os'
    mkdir: created directory `5.4/os/i386'
    mkdir: created directory `5.4/os/x86_64'
    mkdir: created directory `5.4/updates'
    mkdir: created directory `5.4/updates/i386'
    mkdir: created directory `5.4/updates/x86_64'

    Just run this same command each time there is a new version and you are all set for your update script.

© [How2CentOS]
credit