############ #creat Local yumsource##############
Mkdir/westos # # build directory /westos
Mount/iso/rhel-server-7.1-x86_64-dvd.iso/westos # # mount the image file to /westos
Mkdir/backup # # build directory /backup
mv/etc/yum.repos.d/*/backup # # to move the interference files under /etc to the/backup
Cat >/etc/yum.repos.d/yum.repo <<end # # Edit Warehouse file
[Test]
Name=test
Baseurl=file:///westos
Gpgcheck=0
End
Yum Clean All # # Refresh Warehouse Configuration
############# #install shareserver#####################
Yum install httpd-y # # installation httpd
Systemctl Start httpd # startup httpd
Systemctl Enable httpd # # boot start httpd
systemctl Stop Firewalld # # shutting down the firewall
Systemctl Disable FIREWALLD # # boot does not start the firewall
############### #mount ISO to sharedirectory#############
Umount/westos # # Cancel image file Mount
mkdir/var/www/html/rhel7.1 # # #/var/www/html in the directory /rhel7.1
mount/iso/rhel-server-7.1-x86_64-dvd.iso/var/www/html/rhel7.1 ## mount the image file to /rhel7.1
echo "/iso/rhel-server-7.1-x86_64-dvd.iso/var/www/html/rhel7.1 iso9660 ro 0 0" >>/etc/fstab
# # Change temporary mount to permanent Mount
################# #cofig localyum######################
Cat >/etc/yum.repos.d/yum.repo <<end # # re-edit the file /yum.repo
[Test]
Name=test
baseurl=file:///var/www/html/rhel7.1
#baseurl =http://172.25.38.250/rhel7.1
Gpgcheck=0
End
enter http://172.25.38.250/rhel7.1 in the browser to see if the Yum source is configured successfully
This article from the "11904005" blog, reproduced please contact the author!
Linux system local Yum source configuration