zoukankan      html  css  js  c++  java
  • 本地局域网yum源搭建-centos/redhat

    环境-centos6.7  【本机yum搭建提前备好,不做介绍】

    [root@nagios ~]# cat /etc/redhat-release
    CentOS release 6.7 (Final)

    本地yum源的搭建一般有两种形式,http和ftp,这里我们选择使用http方式搭建

    [root@nagios ~]# yum install -y createrepo httpd

    [root@nagios ~]# mkdir -p /yum/centos6.7/Packages

    拷贝iso镜像中所有rpm包到yum源目录

    [root@nagios ~]# cp -a /media/Packages/* /yum/centos6.7/Packages

    然后生产创建仓库

    [root@nagios ~]# createrepo /yum/centos6.7
    Spawning worker 0 with 3204 pkgs
    Workers Finished
    Gathering worker results

    Saving Primary metadata
    Saving file lists metadata
    Saving other metadata
    Generating sqlite DBs
    Sqlite DBs complete

    [root@nagios ~]# ls /yum/centos6.7/
    Packages  repodata  TRANS.TBL

    启动httpd服务并加入开机启动

    [root@nagios ~]# service httpd start | chkconfig httpd on

    修改http网站根目录

    DocumentRoot "/yum"
    
    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories). 
    #
    # First, we configure the "default" to be a very restrictive set of 
    # features.  
    #
    <Directory />
        Options Indexes FollowSymLinks
        AllowOverride None
     Order Deny,Allow
     Allow from all
    </Directory>

    以及

      # This should be changed to whatever you set DocumentRoot to.
      #
    <Directory "/yum">

     本地http方式查看

    至此搭建完成,可以将各种需要的rpm包统统放进此配置目录

    其他主机yum源配置将路径修改为http://ip/centos6.7/即可

    eg:客户端上yum源配置如下


    [2.11] name=centos baseurl=http://192.168.2.11/centos6.7/ enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  • 相关阅读:
    Ubuntu 8.04安设nVidia新版表现驱动
    特性化设置你的linux环境
    Ubuntu 8.04 去失踪文泉驿的点阵字形的方法
    Fedora Nightlife项目 扶助较劲争论机的空闲
    Ubuntu显卡驱动不精确,进入黑屏的处置装备
    Linux中翻开带flash网页主动封锁的处理办法
    Firefox 3 Alpha 5
    Ubuntu 8.04无法正常关机成就处置惩罚
    Redhat Enterprise Linux 5.2 公布了
    KOffice 1.6.3
  • 原文地址:https://www.cnblogs.com/hsia2017/p/7255352.html
Copyright © 2011-2022 走看看