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

原创 2011年01月21日 09:04:00

这是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

自己搭建内网服务器

自己搭建内网服务器最近在折腾服务器,记录一下自己的过程 vmware安装centos minimal,NAT模式,具体教程网上很多,这里就不一一说明了 安装wget,命令:yum -y install...
  • Summerainx
  • Summerainx
  • 2016-10-15 12:25:51
  • 461

局域网内建立git服务器,并实现不同主机的代码共享(无需通过github网站)

最近需要用MATLAB在远程的服务器上的GPU跑深度学习的程序,但是可视化连接了远程服务器以后,操作非常的卡顿,所以我就在本机上调试好代码,在本机的cpu下跑通了,再搬到服务器上改一下配置用GPU去跑...
  • qq_25352981
  • qq_25352981
  • 2017-10-18 09:53:37
  • 289

局域网 FTP建立,搭建一个简易的局域网服务器

1.创建用户名以及密码: 右键我的电脑 -》 管理-》本地用户和组-》右键用户-》新用户----设置用户名密码;   2.安装IIS 和FTP :控制面板-》程序-》打开或关闭windows功能-》...
  • zxc_helloworld
  • zxc_helloworld
  • 2017-08-08 22:45:44
  • 1835

搭建自己的vpn,访问局域网

ubuntu 服务器搭建 Shadowsocks 服务 1. shadowsocks 服务器安装 更新软件源 sudo apt-get update1 然后安装 PIP 环境 ...
  • m0_37499059
  • m0_37499059
  • 2017-10-24 19:34:45
  • 1668

局域网内使用linux搭建NTP服务器

由于工作需要,要搭建一个局域网内的NTP服务器,期间遇到了各种问题。 经过上网查找相关资料和反复试验,终于把NTP server搭建成功了。 在这里感谢一下论坛里的cxgsuda同学。 虽然cx...
  • Amerkor
  • Amerkor
  • 2014-06-20 15:40:15
  • 2423

linux搭建本地局域网yum源

环境centos6.2 搭建yum有两种协议http和ftp比较常用的是http,我这主要介绍http的方式。 1、环境准备 在准备搭建yum源的服务器上安装httpd和createrepo,如...
  • alangmei
  • alangmei
  • 2014-03-30 21:01:45
  • 2885

Windows2012内网更新服务器部署

准备工作全新安装的一台windows2012R2X64系统,为了区分,本文把外网服务器更名为WSUS,内网服务器更名为LSUS。1:通过添加角色和功能安装net framework3.5,以支持SQL...
  • qq_17054989
  • qq_17054989
  • 2018-04-07 12:27:14
  • 102

配置局域网YUM源

当前负责的项目有几十台Linux服务器,在安装各类软件的时候需要大量依赖包,而项目部署的环境属于内网环境,与Internet网完全隔离,无法采用配置网络yum源的方式安装rpm包,直接在每天linux...
  • baidu_33810735
  • baidu_33810735
  • 2017-04-25 18:30:03
  • 2104

如何创建redhat的yum的本地源和使用163服务器的源

这里边利用iso镜像文件提供的包作为rpm包源1:首先将镜像文件中的rpm包拷贝到一个文件中,如:/usr/mysoft/yum/Packages 中,cp /media/RHEL_6.4\ x86_...
  • liufunan
  • liufunan
  • 2016-07-26 22:28:59
  • 1377

移动公司服务器日常管理手册

  • 2011年12月14日 19:39
  • 331KB
  • 下载
收藏助手
不良信息举报
您举报文章:在公司局域网建立一个 REDHAT LINUX更新服务器
举报原因:
原因补充:

(最多只允许输入30个字)