星期五, 12月 11, 2009

[Linux] How to setup reposity on Centos and RHEL.

http://doc.linuxpk.com/58088.html

我寫下簡單的command

1. mkdir /centos.source/5.3/
mkdir /RHEL.source/5.2/
2. centos
15 5 * * * rsync -aqzH --delete msync.centos.org::CentOS/5.3 /cent.source/
RHEL
cp RHEL_source /RHEL.source/5.2/
3. centos
vim /etc/httpd/conf.d/cent.mirror.conf
content:
Alias /CentOS "/cent.source/"

Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all


RHEL
vim /etc/httpd/conf.d/RHEL.mirror.conf
content:
Alias /RHEL "/RHEL.source/"

Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all


4. RHEL
mv /RHEL.source/5.2/Server/repodata /RHEL.source/5.2/Server/backup_repodata
yum install createrepo 或 rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm
mkdir /RHEL.source/5.2/Server/repodata
cd /RHEL.source/5.2/Server/repodata
createrepo -g /RHEL.source/5.2/Server/backup_repodata/comps-rhel5-server-core.xml /RHEL.source/5.2/Server

5. centos
cd /etc/yum.repos.d/
vim CentOS-Base.repo
content:
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://xxxxxxx/CentOS/5.3/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

RHEL
cd /etc/yum.repos.d/
vim rhel-5.2.repo
content:
[rhel-5.2]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=http://xxxxxxx/RHEL/5.2/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

6. wget http://xxxxxxx/CentOS/5.3/os/$basearch/
wget http://xxxxxxx/RHEL/5.2/Server

Done

沒有留言:

張貼留言