#!/bin/bash
echo ******************** yum ********************
echo * 1. FILE eg:file:///var/www/html/rhel7.2/ *
echo * 2. FTP eg:ftp://172.25.254.250/pub/ *
echo * 3. HTTP eg:http://172.25.254.37/rhel7.2/ *
echo *************************************************
rm -rf /etc/yum.repos.d/*
#清空yum源
mkdir /etc/yum.reps.d/rhel7.2.repo
#创建yum源文件
read -p 'config method(eg:file:///var/www/html/rhel7.2/):'address
cat >>/etc/yum.reps.d/rhel7.2.repo<<end
[rhel7.2]
name=rhel7.2
baseurl=$address
gpgcheck=0
end
#写入yum源配置文件
yum clean all
#更新yum源配置
yum源的shell脚本配置
最新推荐文章于 2024-05-23 16:29:23 发布