10/21 本地yum源搭建,共享 以及 第三方yum仓库搭建

来源:互联网 发布:nba2k16捏脸中国人数据 编辑:程序博客网 时间:2024/05/17 01:22

本地yum源搭建

上传镜像到本地mount ****.iso /mnt/       ##挂载镜像到到/mnt/df                         ##查看挂载情况cd /etc/yum.repos.d/       ##切换到yum仓库这个的配置文件下vim echo.repo              ##建立新的repo文件cat echo.repo                  [rhel7]   name=rhel7   baseurl=file:///mnt/   enabled=1   gpgcheck=0yum clean all           //清除缓存yum repolist            //列出软件包有哪些yum install lftp -y    //安装这个服务

这里写图片描述

本地yum源通过http共享

1)服务端yum install httpd -y    systemctl stop firewalld  systemctl disable firewalldsystemctl start httpdsystemctl enable httpd建立共享目录,并挂在镜像文件到共享目录上mkdir -p /var/www/html/rhel7mount /dev/sr0 /var/www/html/rhel7.1df          ##参看设备挂载情况可以通过在浏览器中输入:http://服务端ip/rhel7可以看到镜像中的内容,代表挂载没有问题**修改本机yum源指向[server]name=rhel7.1baseurl=file:///var/www/html/rhel7gpgcheck=0**(2)客户端vim haha.repo              ##建立新的repo文件cat haha.repo                  [rhel7]   name=rhel7   baseurl=http://服务端ip/rhel7   enabled=1   gpgcheck=0yum clean all           //清除缓存yum repolist            //列出软件包有哪些

建立共享目录,并挂在镜像文件到共享目录上
mkdir -p /var/www/html/rhel7
mount /dev/sr0 /var/www/html/rhel7
这里写图片描述
vim haha.repo ##建立新的repo文件
这里写图片描述
yum clean all 清除缓存
在浏览器中输入http://172.25.254.88/rhel7 看看是否搭建成功:
这里写图片描述
成功!

建第三方软件仓库

mkdir /software  ##建立第三方软件存放目录cd /software/createrepo /software/  ##扫描第三方软件目录vim /etc/yum.repos.d/ano.repo   [software] name=software baseurl=file:///software/ enabled=1 gpgcheck=0yum clean all   //清除缓存yum repolist    //列出仓库包

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述

原创粉丝点击