The method of CentOS system to build local yum server _linux

Source: Internet
Author: User
Tags create index install php mkdir

Objective

First of all, specifically, Yum is just to solve the problem of RPM dependencies, rather than a different software installation mode. Although in the CentOS can directly use the Yum source, but also exists with the external network isolation of the status quo, so need to build a local Yum source, below to see the detailed method.

System: CentOS 6.5

1. Mount the disc under/MNT

# mount/dev/cdrom/mnt

2, delete the system from the repo file

# cd/etc/yum.repos.d/# 
mkdir bak 
# mv *.repo Bak

3, install Createrepo(in fact, as long as the installation of Createrepo can be, but need other dependencies, so also have to install)

# cd/mnt/packages/# 
RPM-IVH libxml2-python-2.7.6-14.el6.x86_64.rpm #  
RPM-IVH deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm  
# RPM-IVH python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm  
# RPM-IVH createrepo-0.9.9-18.el6.noarch.rpm

4, use the Createrepo command to create the Yum Warehouse, create INDEX information

Note: Here we set up the Yum warehouse in/doiido/local

# mkdir/doiido/local # 
cp-rv/mnt/packages/*/doiido/local # 
cd/doiido/local 
# createrepo-v/doiido/local

5, if need to group information

# cp/mnt/repodata/b4e0b9342ef85d3059ff095fa7f140f654c2cb492837de689a58c581207d9632-c6-x86_64-comps.xml/doiido/ Local/comps.xml 
# createrepo-g/doiido/local/comps.xml/doiido/local

6. Edit your own repo files

# Vi/etc/yum.repos.d/local.repo 
#库名称 
[local_server] 
 
#名称描述 
name=thisis a local repo 
 
# Yum Source directory 
baseurl=file:///doiido/local 
 
#是否启用该yum源, 0 for disabled 
enabled=1 
 
#检查GPG-key (0 for no check, 1 for check) 
Gpgcheck=0

7. Load Yum Cache

# yum Clean all 
# yum Makecache

8. Test download

# yum-y Install PHP

Here you can see that you can install PHP directly without having to download it online.

Summarize

The above is in the CentOS system to build a local Yum server method, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.

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.