1 : 软件仓库的创建

1.1 在软件仓库管理器上安装epel源及yum-downloadonly 和 createrepo软件包

    rpm -Uvh http://mirrors.sohu.com/fedora-epel/6Server/x86_64/epel-release-6-8.noarch.rpm 

    yum -y install yum-downloadonly createrepo

1.2 创建软件仓库地址

    mkdir -pv /data/mirrors/centos/6/os/x86_64/RPMS

1.3 下载软件包

    yum install nginx -y --downloadonly --downloaddir=/data/mirrors/centos/6/os/x86_64/RPMS/

1.4 创建仓库

    createrepo /data/mirrors/centos/6/os/x86_64/

1.5 web发布

    yum -y install nginx

    配置nginx.conf

    在httpd{} 中添加    

    目录显示:

    autoindex on;   

    虚拟主机:

    include /usr/local/nginx/vhosts/*.conf

    创建虚拟主机mirrors.conf

    server

        {

        listen 80;

        server_name salt-master;

        root /data/mirrors;

        index index.html

        }

1.6 客户端配置repo

vim /etc/yum.repo/mirrors.repo

[base]

name=CentOS-$releaserver -Base

baseurl=http://salt-master:80/centos/$releaserver/os/$basearch/

enabled=1

gpgcheck=0

1.7 另外一种软件包下载方式

yum -y install yum-utils

yumdownloader puppet

puppet包就会安装在当前目录

扩展功能:

查找包网络地址:

yumdownloader --urls php

[root@salt-master ~]# yumdownloader --urls puppet

 Failed to set locale, defaulting to C

 Loaded plugins: fastestmirror

 Loading mirror speeds from cached hostfile

 * base: mirrors.yun-idc.com

 * epel: mirrors.neusoft.edu.cn

 * extras: mirrors.yun-idc.com

 * updates: mirrors.yun-idc.com

http://yum.puppetlabs.com/el/6/products/x86_64//puppet-3.5.1-1.el6.noarch.rpm