在公司局域网建立一个 REDHAT LINUX更新服务器

这是06年帮公司做的一个在公司内部更新redhat linux服务器

这里以Fedora3为例:

首先确定http服务是可以用

在/var/www/html/ 后建立目录yum/Fedora/Corel/3/base

建立后目录:/var/www/html/yum/Fedora/Corel/3/base

同样建立目录:/var/www/html/yum/Fedora/Corel/3/updates

将Fedora3安装盘base下所有文件抄一份到:/var/www/html/yum/Fedora/Corel/3/base

建立一个自动更新文件:yum_update.cron  (文件名自定)
保存在目录/etc/cron.daily/
以下是我的内容:

##### for redhat fedora3  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/3/i386/*.rpm /var/www/html/yum/Fedora/Core/3/updates
createrepo /var/www/html/yum/Fedora/Core/3/updates

##### for redhat fedora4  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/4/i386/*.rpm /var/www/html/yum/Fedora/Core/4/updates
createrepo /var/www/html/yum/Fedora/Core/4/updates

##### for redhat fedora5  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/5/i386/*.rpm /var/www/html/yum/Fedora/Core/5/updates
createrepo /var/www/html/yum/Fedora/Core/5/updates

##### for redhat fedora6  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/6/i386/*.rpm /var/www/html/yum/Fedora/Core/6/updates
createrepo /var/www/html/yum/Fedora/Core/6/updates

##### for linux centos4.2  #####
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.2/os/i386/ /var/www/html/yum/Centos/4.2/base/
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.2/updates/i386/ /var/www/html/yum/Centos/4.2/updates/

##### for linux centos4.3  #####
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.3/os/i386/ /var/www/html/yum/Centos/4.3/base/
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.3/updates/i386/ /var/www/html/yum/Centos/4.3/updates/

rsync -avz rsync://mirrors.kernel.org/fedora/extras/3/i386/*.rpm  /var/www/html/yum/Fedora/Core/3/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/3/extras/i386

rsync -avz rsync://mirrors.kernel.org/fedora/extras/4/i386/*.rpm  /var/www/html/yum/Fedora/Core/4/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/4/extras/i386

rsync -avz rsync://mirrors.kernel.org/fedora/extras/5/i386/*.rpm  /var/www/html/yum/Fedora/Core/5/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/5/extras/i386

rsync -avz rsync://mirrors.kernel.org/fedora/extras/6/i386/*.rpm  /var/www/html/yum/Fedora/Core/6/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/6/extras/i386

##### for linux kernel v2.6  #####
rsync -avz rsync://kernel.org/pub/linux/kernel/v2.6/ /var/www/html/yum/Kernel/v2.6/

192.168.4.252是服务器IP

将首页照搬上来:

Yellowdog Updater Server


    Fedora3    Fedora4    Fedora5    Fedora6   CentOS    Kernel


Fedora3      

Configuring Fedora clients There are two ways that allow you to update local Fedora clients to download updates from our new server. The first is 'yum' (command line) and second 'up2date' (graphical). Up2date uses yum anyway. To continue with yum as your solution, open the /etc/yum.repos.d/fedora.repo file in VI or you editor of choice and change the entries as below.

[base]
name=Fedora Core $releasever - $basearch - Base
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=http://192.168.4.252/yum/Fedora/Core/3/base/
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1
download:fedora.repo(for fc3)
Open the /etc/yum.repos.d/fedora-updates.repo file and change the entries as below.
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
baseurl=http://192.168.4.252/yum/Fedora/Core/3/updates/ 
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc/$releasever
enabled=1
gpgcheck=1
download:fedora-updates.repo(for fc3)
Save the changes to these files.
Almost there. You need to install the public key from Fedora. Enter the folowing command:
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora 
NOW you are ready. At the client, enter the following command:
yum update

Fedora4      

Configuring Fedora clients There are two ways that allow you to update local Fedora clients to download updates from our new server. The first is 'yum' (command line) and second 'up2date' (graphical). Up2date uses yum anyway. To continue with yum as your solution, open the /etc/yum.repos.d/fedora.repo file in VI or you editor of choice and change the entries as below.

[base]
name=Fedora Core $releasever - $basearch - Base
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=http://192.168.4.252/yum/Fedora/Core/4/base/
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1

download:fedora.repo(for fc4)
Open the /etc/yum.repos.d/fedora-updates.repo file and change the entries as below.
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
baseurl=http://192.168.4.252/yum/Fedora/Core/4/updates/
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc/$releasever
enabled=1
gpgcheck=1

download:fedora-updates.repo(for fc4)
Save the changes to these files.
Almost there. You need to install the public key from Fedora. Enter the folowing command:
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora 
NOW you are ready. At the client, enter the following command:
yum update

CentOS4.2

CentOS4.3


Kernel

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值