Install local yum source on CentOS7 step tutorial, centos7yum source step

Source: Internet
Author: User
Tags yum repolist

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.