Use the centos installation disk to set the centos source in the LAN

Source: Internet
Author: User

When using centos, It is very convenient to install software using the yum command, but if there is no network, you have to talk about it. Currently, our group has about 100 centos servers in the data center. However, due to security policy issues in the data center, these 100 servers are not allowed to access the Internet. In this way, a software is installed, it becomes very troublesome. So I was wondering if I could set up a local data source?

1. Data Sources in centos

Configure Yum update source centos5.x default Yum Update Configuration File in/etc/yum. repos. under the D/directory, there are two Warehouse configuration file CentOS-Base.repo: for setting remote warehouse CentOS-Media.repo: for setting local warehouse.

Since our data source needs to be accessed throughout the LAN, we take the CentOS-Base.repo to open the knife.

2. Create your own source

The method for establishing the source is simple. Find the centos installation disk (or ISO file) and copy all the files to the data directory of the FTP (or HTTP) service, for example: the default FTP directory is/var/ftp. We can copy it to the/var/FTP/centos directory. After the copy is complete, we can use ftp: // ip/centos to access all the files just copied. These files are the files created from the source.

3. Back up the original CentOS-Base.repo File

 

This step must be done, and we need to develop this habit. Otherwise, once something goes wrong, it will be a tragedy ~

# Mv/etc/yum. Repos. d/CentOS-Base.repo/etc/yum. Repos. d/CentOS-Base.repo.bak

4. Create a New CentOS-Base.repo file with the following content:

[FTP] <br/> name = CentOS-5-localftp <br/> # The server address we created and the path of the centos installation file on the FTP server <br/> baseurl = ftp: // 10.60.1.91/centos <br/> gpgcheck = 1 <br/> enable = 1 <br/> # key file, by default, it is also in the root directory of the installation disk <br/> gpgkey = ftp: // 10.60.1.91/centos/RPM-GPG-KEY-CentOS-5 <br/>

5. Update the data source so that you can use your own source to install the file.

Yum update

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.