Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6968758
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: LINUX

2006-02-21 02:21:45

Total Quality Management - A Commitment to Excellence

Update February 8, 2006: There is a new version of createrepo that optionally creates a local disk cache. This means that you can incrementally update repodata very quickly. Our cron job script now looks like this:

rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/updates/4/i386 \
     --exclude=debug/ --exclude=repodata/ --exclude=*debuginfo* --exclude=*i18* \
     --exclude=*langpack*/var/www/tqmcube/yum/Fedora/core/4/updates

createrepo -q -c /var/www/cache /var/www/tqmcube/yum/Fedora/core/4/updates/i386

repoview -qu http://tqmcube.com/yum/Fedora/core/4/updates/i386 \
     /var/www/tqmcube/yum/Fedora/core/4/updates/i386

In the above example, the "-u" option for repoview creates a RSS feed.

In addition to rawhide, I've made the release available via ftp: ftp://ftp.tqmcube.com/pub/createrepo-0.4.3-5.1.noarch.rpm


Update January 26, 2006: We highly recommend repoview, now available in Fedora Extras. Screen Shots

If you have several computers to update via yum then you should consider creating a local repository. Not only does this conserve bandwidth (updates are downloaded only once) but it improves the responsiveness of yum for installing additional programs. Just about anything that you do with yum is considerably faster (LAN vs. WAN). The downside is that you will probably download updates that are unnecessary for any of your machines. You can reduce this with additional "exclude" statements like "--exclude=*i18*" (see man rsync).


Summary:

  1. Create the directory structure of the repository
  2. Copy the base RPMs
  3. Create the base repository headers
  4. Select an rsync mirror.
  5. Rsync the updates-released repository
  6. Edit yum.conf

Degree of Difficulty:Easy
Requires:Approximately 5 gb of Disk Space
Package: createrepo (su yum -y install createrepo)



1. Create the Directories:

mkdir -pv /var/www/html/yum/{base,updates}


2. Copy the RPMs from the CDs/DVD to /var/www/html/yum/base


3. Create the base repository headers:

"createrepo /var/www/html/yum/base"
This might take some time, depending upon the speed of your processor(s) and HD. On successful conclusion, createrepo should create a directory /repodata. The contents should be:
        filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml


4. Select a rsync mirror for updates:

A list is at and these are identified with “rsync.” For example: "rsync://distro.ibiblio.org/fedora-linux-core/". The mirrors share a common structure for updates. Simply append /updates//. Using FC4, this becomes:
rsync://distro.ibiblio.org/fedora-linux-core/updates/4/i386


5. Rsync to create the updates-released repository:

"rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/updates/4/i386 \
--exclude=debug/ /var/www/html/yum/updates"

This will create a complete update repository at /var/www/html/yum/updates/i386. The repodata directory will be created with all of the headers.

At this point you can create a cron job for the rsync command, above. Only new updates and headers will be downloaded to your repository.


6. Edit /etc/yum.conf:

[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#mirrorlist=
baseurl=
enabled=1
gpgcheck=1

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=
#mirrorlist=
enabled=1
gpgcheck=1

On the machine with the repository, substitute localhost for the IP address.


And that does it. Please use the contact form for feedback, comments, suggestions, edits, rants and raves.

Stop Spam - Take The Pledge

If you want to guarantee that your IPA will be included in our spam trap and distributed blocklist, simply send email to SysAdmin@TQMcube.com and we will be happy to oblige. Otherwise, please use the contact form.


阅读(5420) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~