Build a Local cd yum source using CentOS

Source: Internet
Author: User

Build a Local cd yum source using CentOS

The two hosts are the first to build the YUM and YUM servers, and the second is used for subsequent YUM tests.

Operating System: Centos6.5

Host Name: yum. server

IP Address: 172.20.1.11

Operating System: Centos6.5

Host Name: test1

IP Address: 172.20.1.10

1. Build a Local cd yum Source

[Root @ yum ~] # Mkdir/mnt/cdrom/------ create a CD Mount directory

[Root @ yum ~] # Mount/dev/cdrom/mnt/cdrom/-------- to the CD

[Root @ yum ~] # Cd/etc/yum. repos. d/-------- switch to the YUM configuration directory

Export root@yumyum.repos.d?#tarczfrepo.tar.gz./* -------- package and back up all the original files

[Root@yumyum.repos.d] # rm-fCentOS * -------- Delete the original file

[Root@yumyum.repos.d] # vimCentOS-Media.repo -------- configure the disc source file

C6-media

Name = CentOS-$ releasever-Media

Baseurl = file: // mnt/cdrom -------- here is the Mount directory for your CD

Gpgcheck = 1 -------- whether to enable the GPG-KEY check

Enabled = 1 -------- whether YUM source is enabled

Gpgkey = file: // mnt/cdrom/RPM-GPG-KEY-CentOS-6 -- specifies the GPG-KEY file under the Mount directory

Verification:

2. to make all Linux hosts of the company available with internal source services, you can use FTP/HTTP to build a YUM server. Because Http is relatively simple, here I will build a YUM service using HTTP.

Following the above operations, I borrowed a Local CD source to build an HTTP YUM service!

2.1

HTTP has been installed through YUM. If you have not installed HTTP, you can install it through the installation package on the CD, or through the YUM on the network. Start the http service!Disable firewall and SELinux!

[Root @ yum ~] # Servicehttpdstart

Startinghttpd: httpd: apr_sockaddr_info_get () failedforyum. server [OK]

[Root @ yum ~] # Chkconfighttpdon

[Root @ yum ~] # Serviceiptablesstop

[Root @ yum ~] # Chkconfigiptablesoff

[Root @ yum ~] # Setenforce0

2.2

Create a sub-folder under the Apache root directory. If you want the YUM server to serve Linux of different versions, you can create a directory based on the situation and then CP all the files on the CD to this directory!

Note: Generally, you can use DVD1. Of course, you can also combine DVD1 and DVD2 as the source.

[Root @ yum ~] # Mkdir-p/var/www/html/yum

[Root @ yum ~] # Mkdir-p/var/www/html/yum/CentOS-6

[Root @ yum ~] # Cp-prf/mnt/cdrom/*/var/www/html/yum/CentOS-6/

2.3

Client to modify the CentOS-Base.repo, it is recommended to back up a copy of OH, so that later to be updated from the Internet, you can use.

[Root@test1yum.repos.d] # cpCentOS-Base.repoCentOS-Base.repo.bak1

[Root@test1yum.repos.d] # vimCentOS-Base.repo

################## After the CentOS-Base.repo content is modified, #####################

# CentOS-Base.repo # ThemirrorsystemusestheconnectingIPaddressoftheclientandthe # updatestatusofeach?topick=sthatareupdatedtoand # geographicallyclosetotheclient. youshouldusethisforCentOSupdates # unlessyouaremanuallypickingothermirrors. # Ifthemirrorlist = doesnotworkforyou, asafallbackyoucantrythe # remarkedoutbaseurl = lineinstead. # [base] name = CentOS-$ releasever-Base # Release List = http://mirrorlist.cento S.org /? Release = $ releasever & arch = $ basearch & repo = osbaseurl = http: // 172.20.1.11/yum/CentOS-6enable = 1 gpgcheck = 1 gpgkey = file: /// etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 # releasedupdates [updates] name = CentOS-$ releasever-Updates # updated list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updatesbaseurl = http: // 172.20.1.11/yum/CentOS-6enable = 1 gpgcheck = 1 gpgkey = file: /// etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 # additionalpackagesthatmaybeuseful [extras] name = CentOS-$ releasever-Extras # Release List = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extrasbaseurl = http: // 172.20.1.11/yum/CentOS-6enable = 1 gpgcheck = 1 gpgkey = file: /// etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 # additionalpackagesthatextendfunctionalityofexistingpackages [centosplus] name = CentOS-$ releasever-Plusmirrorlist = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus # baseurl = signature /? Release = $ releasever & arch = $ basearch & repo = contrib # baseurl = Signature

The content of centosplus] [contrib] does not need to be modified. Their default enabled value is 0, that is, the module is not enabled.

2.4

Client test!

Additional:

To merge DVD1 and DVD2 files:

1. CP all rpm files in the Packages directory of the DVD2 disc to the DVD1 directory.

Cp/mnt/dvd2/Packages/*. rpm/var/www/html/yum/CentOS-6/Packages/

2. Merge TRANS. TBL, append the TRANS. TBL information in DVD2 to the end of TRANS. TBL in DVD1, and sort and save it.

Catmnt/dvd2/Packages/TRANS. TBL>/var/www/html/yum/centos-6/Packages/TRANS. TBL

Mv/var/www/html/yum/centos-6/Packages/{TRANS. TBL, TRANS. TBL. BAK}

Sort/var/www/html/yum/centos-6/Packages/TRANS. TBL. BAK/var/www/html/yum/centos-6/Packages/TRANS. TBL

This article from the "you insist on IT blog" blog, please be sure to keep this source http://fdgui.blog.51cto.com/3484207/1431192

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.