首页 > 系统相关 >yum 3种发布配置方式

yum 3种发布配置方式

时间:2023-05-05 11:02:58浏览次数:35  
标签:repoFolder x86 配置 u2 发布 64 var yum

#/bin/bash
#通过ftp发布的yum服务器配置
#iso路径:/data/rhel-server-7.2-x86_64-dvd.iso
#yum服务器ip:192.168.110.10
#FTP路径:/var/ftp/yum/rhel7
#



if ! rpm -q vsftpd > /dev/null
then 
    echo "vsftpd service not found. You need to install and configure it before running this script."
    exit 1
fi
if [ ! -d "/var/ftp/yum/rhel7" ]; then
    echo "The directory /var/ftp/yum/rhel7 does not exist.  Reconfigure your vsftpd service and try again."
    exit 1
fi



repoFolder="/mnt/RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64"
mkdir -p $repoFolder
mkdir -p /var/ftp/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
mount -o loop /data/rhel-server-7.2-x86_64-dvd.iso $repoFolder
shopt -s dotglob
echo "Copying files from $repoFolder/ to /var/ftp/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/"
cp -R $repoFolder/* /var/ftp/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
chmod a+rx -R /var/ftp/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
umount $repoFolder
 


if ! service vsftpd status > /dev/null
then 
    service vsftpd start
fi

chcon -R -t public_content_t /var/ftp/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
 


#/bin/bash
#通过http发布的yum配置
#iso路径:/data/rhel-server-7.2-x86_64-dvd.iso
#yum服务器ip:192.168.110.10
#http路径:/var/www/html/yum/rhel7

if ! rpm -q httpd > /dev/null
then 
    echo "httpd service not found. You need to install and configure it before running this script."
    exit 1
fi
if [ ! -d "/var/www/html/yum/rhel7" ]; then
    echo "The httpd document root /var/www/html/yum/rhel7 does not exist.  Reconfigure your httpd service and try again."
    exit 1
fi



repoFolder="/mnt/RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64"
mkdir -p $repoFolder
mkdir -p /var/www/html/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
mount -o loop /data/rhel-server-7.2-x86_64-dvd.iso $repoFolder
shopt -s dotglob
echo "Copying files from $repoFolder/ to /var/www/html/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/"
cp -R $repoFolder/* /var/www/html/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
chmod a+rx -R /var/www/html/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
umount $repoFolder
 


if ! service httpd status > /dev/null
then 
    service httpd start
fi

chcon -R -t httpd_sys_content_t /var/www/html/yum/rhel7RHEL7/u2/RedHatEnterpriseLinuxServer/x86_64/
 


#/bin/bash
#yum本地配置
#iso路径:/data/rhel-server-7.2-x86_64-dvd.iso
#
#
#


currentTimestamp=`date +%y-%m-%d-%H:%M:%S`
yumRepo=/etc/yum.repos.d/localrepo_RHEL7-7.2-iso.repo
yumRepoBackup=${yumRepo}.${currentTimestamp}
repoFolder="/mnt/RHEL7/u2/iso"
mkdir -p $repoFolder

mount -o loop /data/rhel-server-7.2-x86_64-dvd.iso $repoFolder


if [ -f "$yumRepo" ]; then
    echo "Backup $yumRepo to $yumRepoBackup"
    cp $yumRepo $yumRepoBackup
fi

cat > $yumRepo << EOF
[local-repo-in-iso-by-yum-repo-config-helper]
name=Red Hat Enterprise Linux \$releasever - \$basearch (DVD)
baseurl=file://$repoFolder/
enabled=1
gpgcheck=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
EOF

chmod a+x $yumRepo
yum clean all

标签:repoFolder,x86,配置,u2,发布,64,var,yum
From: https://blog.51cto.com/u_15703497/6245042

相关文章

  • 城市“一网统管”智能视频平台EasyCVR配置中心代码细节优化
    EasyCVR视频融合平台基于云边端一体化架构,具有强大的数据接入、处理及分发能力,平台支持海量视频汇聚管理,能在复杂的网络环境中,将分散的各类视频资源进行统一汇聚、整合、集中管理,实现视频直播、云端录像、云存储、检索回看、智能告警、平台级联、服务器集群、云台控制与语音对讲、......
  • 使用nginx配置https域名证书
    安装SSL模块要在nginx中配置https,就必须安装SSL模块,也就是:http_ssl_module。进入到nginx的解压目录新增SSL模块(原来的那些模块需要保留)./configure\--prefix=/usr/local/nginx\--pid-path=/var/run/nginx/nginx.pid\--lock-path=/var/lock/nginx.local\--e......
  • vue中配置使用axios
    简单示例代码:请求网络的js逻辑,可以放到request.js文件中,放在目录utils下;importaxiosfrom"axios";axios.defaults.withCredentials=true;//创建axios实例constinstance=axios.create({//`headers`请求头的通用配置headers:{//'X-Requested-W......
  • 虚拟机配置bond网卡mode为4的提醒解决
    虚拟机配置bond网卡mode模式为4时控制台一直循环输出:May411:32:03local-huajingkernel:bond0:(slaveens33):Anillegalloopbackoccurredonslave#012Checktheconfigurationtoverifythatalladaptersareconnectedto802.3adcompliantswitchportsMay4......
  • Gradle安装配置教程
    一、安装前检查检查电脑上是否安装JDK,如果没有安装,请查看JDK安装教程:点击查看如果电脑上已经安装JDK,按Win+R键,输入cmd,然后点击确定输入java-version,点击回车,查看JDK安装信息,如果有下面提示信息,说明JDK安装成功二、Gradle下载打开官网下载界面:https://gradle.or......
  • STP02(配置命令)
    1.MSTP  -默认情况下,所有的VLAN都属于实例0(系统的默认instance);  -一个MSTP网络中,可以同时包含多个region;  -每个MSTregion中可以包含多个instance(MSTI)  -属于相同region的交换机上,以下参数必须相同:     #region-name     #实例与vlan的映射关系必......
  • 消息推送平台终于要发布啦!
    我的开源项目消息推送平台Austin终于要上线了,迎来在线演示的第一版!......
  • 英伟达发布 RTX30 系列 ,纪念的是 21 年前的哪张神卡?
    By超神经内容概要:英伟达在今天凌晨发布了RTX30系列新品,在此之前的宣传内容中多次提及21年前的重大发布,本文将回顾21年前的1999年前后,NVIDIA所经历的重要时刻。关键词:英伟达GPU商业分析美西时间9月1日清晨,NVIDIACEO黄仁勋继续在厨房进行新品发布。本次重磅发布的......
  • 黄仁勋:英伟达收购 ARM 是谣言,下周发布会有惊喜
    By超神经内容提要:近期,英伟达发布了第二季度财报,业绩喜人,再创新高。公司CEO黄仁勋随后还接受了Venturebeat旗下游戏频道Gamesbeat的记者采访,就英伟达目前现状、游戏行业发展等发表了自己的见解。关键词:英伟达黄仁勋 GeForce美国当地时间8月19日,英伟达发布了2021财年......
  • Linux配置添加自定义shell脚本需要的PATH
    Linux添加自定义shell脚本记录下,便于之后复习使用。1.确定一个目录e.g.#到达用户目录cd~#创建一个bin文件夹来放脚本文件mkdirbincd./binpwd得到的是/root/bin2.把这个路径放到PATH中cd~#可以用ls-a看一看有没有.branrc文件vim~/.bashrc#编辑最后加入......