文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Create a Local Yum Repository

Create a Local Yum Repository

时间:2006-02-21  来源:wenzk

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 http://fedora.redhat.com/download/mirrors.html 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/<d version>/<base arch>. 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=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
baseurl=http://192.168.0.xx/yum/updates/$basearch/
enabled=1
gpgcheck=1

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://192.168.0.xx/yum/Fedora/core/$releasever/base/RPMS
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
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.

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

相关阅读 更多 +
排行榜 更多 +
战地方块战场中文版下载

战地方块战场中文版下载

飞行射击 下载
云原神国际服手机版下载

云原神国际服手机版下载

角色扮演 下载
海之号角柯罗诺斯地下城手机版下载

海之号角柯罗诺斯地下城手机版下载

角色扮演 下载