Automatic configuration of local yum

Automated configuration yum adopts local yum. What are the disadvantages? Please advise the test environment virtual machine to mount the CD image

#!/bin/bash
###install localtion yum

cd /etc/yum.repos.d
mv * /opt
cat > /etc/yum.repos.d/local.repo << EOF
[local-yum]
name=local-yum
baseurl=file:///opt/local-yum
enabled=1
gpgcheck=0
EOF
mkdir /opt/local-yum
#一下可以使用sr0
mount /dev/cdrom /opt/local-yum
yum clean all; yum makecache 
yum install -y vsftpd  && 
echo "anon_root=/opt/local-yum" >> /etc/vsftpd/vsftpd.conf   
systemctl start vsftpd && 
systemctl enable vsftpd 

systemctl stop firewalld 
systemctl disable firewalld 
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0   
echo "/dev/cdrom /opt/local-yum iso9660 defaults 0 0 " >> /etc/fstab 
mount -a 

Guess you like

Origin blog.csdn.net/smileui/article/details/106738039