制作red hat本地光盘yum

#!/bin/bash
read -p "请确认插入系统光盘,然后按Enter继续"
mkdir -p /mnt/centos6.5
mount /dev/cdrom /mnt/centos6.5
cat > /etc/yum.repos.d/centos-debuginfo.repo << EOF
[Cluster]
name=Cluster Directory
baseurl=file:///mnt/centos6.5/Cluster
enabled=1
gpgcheck=0
[ClusterStorage]
name=ClusterStorage Directory
baseurl=file:///mnt/centos6.5/ClusterStorage
enabled=1
gpgcheck=0
[Server]
name=Server Directory
baseurl=file:///mnt/centos6.5/Server/
enabled=1
gpgcheck=0
[VT]
name=VT Directory
baseurl=file:///mnt/centos6.5/VT
enabled=1
gpgcheck=0
EOF
sed -e '411s/url/\"\/mnt\/rhel5\/Server\"/g' /usr/lib/python2.4/site-packages/yum/yumRepo.py > /tmp/123
mv -f /tmp/123 /usr/lib/python2.4/site-packages/yum/yumRepo.py
yum install mysql*

本文转载自维斯亚技术论坛:http://www.w4ya.com

你可能感兴趣的:(linux,yum)