Build a local yum server in linux/centos
YUM is Yellow dog Updater, short for Modified. It is a plan initiated by Duke University to solve the problem of RPM dependency, it is convenient for users to install and upgrade software. It is particularly noted that YUM is only used to solve RPM dependency problems, rather than other software installation modes.
Although yum sources can be directly used in centos, they are isolated from the Internet. Therefore, you need to build a local yum source.
System: centos 6.5
1. Mount the disc to/mnt
# Mount/dev/cdrom/mnt
2. Delete the repo files that come with the System
# Cd/etc/yum. repos. d/
# Mkdir bak
# Mv *. repo bak
3. Install createrepo (in fact, you only need to install createrepo, but you need other dependent packages, so you must install them together)
# 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. Run the createrepo command to create a yum repository and create index information.
Note: here we create the yum repository in/doiido/local
# Mkdir/doiido/local
# Cp-rv/mnt/Packages/*/doiido/local
# Cd/doiido/local
# Createrepo-v/doiido/local
5. group information if necessary
# 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 File
# Vi/etc/yum. repos. d/local. repo
# Library name
[Local_server]
# Name Description
Name = Thisis a local repo
# Yum source directory
Baseurl = file: // doiido/local
# Whether to enable the yum source. 0 indicates disabled.
Enabled = 1
# Check the GPG-KEY (0 is not checked, 1 is checked)
Gpgcheck = 0
7. Load yum Cache
# Yum clean all
# Yum makecache
8. Test download
# Yum-y install php
Here we can see that php can be directly installed without the need to download it online.