Yum LAN software source setup

Source: Internet
Author: User

1. Build Apache server or FTP server

Yum Install–y httpd

Serivce httpd Start (host's address is 192.168.176.128)
Yum installation or binary package installation
2, prepare the RPM package to the CentOS DVD1 and Dvd2.iso are downloaded, the Dvd1.iso all the content extracted, put into the/var/www/html/centos-6 directory, Then the dvd2.iso extracted from the packages directory of the RPM package copied to the/var/html/centos-6/packages directory, so/var/html/centos-6/packages there are more than 6,000 RPM package.

Mkdir/var/www/htm/centos-6

mount/dev/sr0/mnt/

cp/mnt/packages/*/var/www/html/centso-6/#将光盘内包含的rpm包复制到/var/www/html/centso-6/

To access the Web:

Http://192.168.176.128/centos-6

The following interface will appear:


3. Create a Yum repository
Prepare createrepo:yum-y Install Createrepo
Create repository:createrepo/var/www/html/centos-6/
After the creation is complete, some files are generated under/var/www/html/centos-6/repodata.

4. Using the software source

Try a software source on another CentOS machine.

First modify the software source configuration file on the machine:

# cd/etc/yum.repos.d/
# mkdir BK
# MV *.repo bk/
# CP Bk/centos-base.repo./
# VI Centos-base.repo

The Centos-base.repo file is modified as follows:

[Base]
name=centos-$releasever-base
baseurl=http://*.*.*.*/centos-6/#其中星号的地方改为192.168.176.128, hereinafter
Gpgcheck=1 (change to 0 below the line is not set up)
Gpgkey=http:///*.*.*.*/centos-6/rpm-gpg-key-centos-6
Enabled=1
#released Updates
#[updates]
#name =centos-$releasever-updates
#baseurl =http:///*.*.*.*/centos-6/
#gpgcheck =1
#gpgkey =http:///*.*.*.*/centos-6/rpm-gpg-key-centos-6
#enabled = 1

Once saved, you can use the local area network's software Source:

# Yum Update

Original address: http://www.linuxidc.com/Linux/2013-07/87315.htm

Yum LAN software source setup

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.