centos7 搭建本地yum源

介绍本地yum源服务器主要缘由是安全、稳定性比较好,本地yum源服务器也解决了更新、安装软件时,占用生产业务网络或影响业务。html

1.安装http服务器nginx

 yum  install  httpd  startweb

yum install createrepo       建立仓库的软件包。 centos



2.建立镜像文件目录浏览器

   mkdir  yum/centos/5缓存

   mkdir  yum/centos/6安全

   mkdir  yum/centos/7服务器



3.拷贝光盘到相应的目录下网络

  一下以centos7 为例oop

      mount -o  loop   /data/CentOS-7-64-bin-DVD1.iso   /mnt

    cp   -ar  /mnt/     /var/www/html/7/   


     


4.浏览器访问: http://localhost/yum/7/



5.下面以nginx  RPM包为例

   (1)下载nginx 

            wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

            cp   /data/tools/nginx-release-centos-7-0.el7.ngx.noarch.rpm      /var/ww/html/yum/7/Packages/

      

     (2) 建立yum仓库信息文件

       createrepo     /var/www/html/yum/

       查看生产目录

        


6.客户端建立  .repo文件

   我在客户端建立的文件名 yum.repo 

     

   

    yum  clean  all   清楚yum源缓存

    查看yum源有没有nginx包

    

         

   至此centos7本地yum源服务器已搭建完成。

相关文章
相关标签/搜索