Install local yum source on CentOS7 step tutorial, centos7yum source step
Install local yum source on CentOS7
Upload the system image to the server where the yum local source is to be installed; mount the image file CentOS-7-x86_64-Everything.iso to the appropriate directory:
Create a mount Directory: mkdir/mnt/iso
Mount-o loop CentOS-7-x86_64-Everything.iso/mnt/iso
Back up the original yum source configuration file;
Cd/etc/yum. repos. d/
Rename. repo. repo. bak *
Create a local yum file: vi CentOS-Local.repo, add the following, save and exit:
[Base]
Name = CentOS-Local
Baseurl = file: // mnt/iso
Gpgcheck = 1
Enabled = 1 # Very important, 1 is enabled
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Clear YUM Buffer:
Yum clean all lists available yum sources:
Yum repolist all
Install the appropriate software:
Yum install-y httpd enable httpd to access http: // 220.192.10.132: 80 using a browser (if access fails, check whether port 80 is enabled or the firewall is disabled)
Service httpd start
Configure the YUM source to httpd (Apache Server). Other servers can access the YUM source in the Intranet over the network:
Cp-r/mnt/iso // var/www/html/CentOS-7 cancel previously mounted image:
Umount/mnt/iso access http: // 220.192.10.132/CentOS-7 in a browser, if the following content appears, the setting is successful:
Let other servers that need to install the RPM package point to this YUM source, prepare a new server, back up or delete the original YUM source configuration file:
Cd/etc/yum. repos. d/
Rename. repo. repo. bak *
Vi CentOS-Local.repo
[Base]
Name = CentOS-Local
Baseurl = http: // 220.192.10.132/CentOS-7
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Run the YUM command on the new server to check whether the configuration is successful:
Yum clean all
Yum repolist all if the previous step is successful, you can install the corresponding software.