歡迎您光臨本站 註冊首頁

為CentOS5構建本地yum倉庫

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0
項目中大量使用CentOS5作為運行平台,測試需要經常安裝系統,每次要升級的文件越來越多,構建內部倉庫一來方便安裝,二來方便升級...
---
[服務端]
創建基本倉庫,並copy DVD或者CD文件(減少網路下載量)
Copy the RPMs from the CDs/DVD to /var/www/html/centos/5/base.
1. mount -o loop,ro CentOS-xxxxx.iso /mnt
2. cp -r /mnt /var/www/html/centos/5/base
同步遠端倉庫
3./usr/bin/rsync -avrt --delete rsync://rsync.muug.mb.ca/centos/5/os/i386/ /var/www/html/centos/5/os/i386/



同步update倉庫
例子:
/usr/bin/rsync -avrt rsync://rsync.muug.mb.ca/centos/5/updates/i386/ /opt/repos/yum/centos/5/updates/i386/

鏡像在這裡的列表中選中快的
http://www.centos.org/modules/tinycontent/index.php?id=30



客戶端使用倉庫

[base]
name=CentOS-$releasever - Base
baseurl=http://192.168.xx.xx/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates

[update]
name=CentOS-$releasever - Updates
baseurl=http://192.168.xx.xx/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


[火星人 ] 為CentOS5構建本地yum倉庫已經有359次圍觀

http://coctec.com/docs/linux/show-post-53593.html