CentOS build local YUM service

Source: Internet
Author: User
I think everyone is familiar with the YUM service in linux. I have previously written down the steps for building the YUM in linux redhat. today I mainly want to write about how to build the YUM in centos, although centos is a clone version of redhat, there are many differences. This link explains how to structure the redhat...

 

I think everyone is familiar with the YUM service in linux. I have previously written down the steps for building the YUM in linux redhat. today I mainly want to write about how to build the YUM in centos, although centos is a clone of redhat, there are many differences;

This link explains how to build YUM, http://www.linuxdiyf.com/bbs/viewthread.php on redhat? Tid = 204212 & extra = page % 3D2% 26amp % 3 Borderby % 3 Ddateline

The following describes how to build YUM in CentOS.

1. first, mount the image disk: mount/dev/cdrom/media/cdrom/

2. install the http package, rpm-ivh/media/cdrom/CentOS/httpd-2.2.3-43.el5.centos.i386.rpm

3. install common RPM packages of YUM (some packages are installed by default, but check whether the packages are installed)

Rpm-ivh/media/cdrom/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm

Rpm-ivh/media/cdrom/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm

Rpm-ivh/media/cdrom/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm

Rpm-ivh/media/cdrom/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm

4. create a custom directory to store your RPM Package. it is also the http access directory:/data/CentOS/i386/

Copy the collection of the mounted rpm Package to/data/CentOS/i386/(because it is impossible for you to attach it to your image disk for a lifetime)

\ Cp-rf/media/cdrom/CentOS // data/CentOS/i386/

5. copy the repodata/in/media/cdrom to/data/CentOS/i386/CentOS.

Cp-rf/media/cdrom/repodata // data/CentOS/i386/CentOS/(will be used later)

6. install rpm-ivh/media/cdrom/CentOS/createrepo-0.4.11-3.el5.noarch.rpm (this package is used to install server-side setup software repository and information files)

Rpm-ivh/media/cdrom/CentOS/createrepo-0.4.11-3.el5.noarch.rpm

7. start the http service and the service httpd start first. if this service cannot be done, everything else will be useless)

Netstat-anpt | grep 80

Tcp 0 0: 80: * LISTEN 8389/httpd

8. generate the information file required by the client

Createrepo-g/media/cdrom/repodata/comps. xml/data/CentOS/i386/

9. Upload The key File (for client and server authentication) to the specified directory/data/CentOS/i386.

Cp, media, cdrom, RPM-GPG-KEY-CentOS-5, data, CentOS, i386/

10. modify the http service configuration file. how do you install httpd by default? the configuration file path is:

Vi/etc/httpd/conf/httpd. conf

Modify the two rows: (the changed rows are displayed)

DocumentRoot "/data/CentOS /"

Save and exit .. Restart httpd service, and service httpd restart

 

11. use your IE browser to check if you can access http: // 172.16.17.140/i386/CentOS/. The rpm Package is correct.

 

12. make a backup before changing the configuration file of yum.

, Cp CentOS-Base.repo CentOS-Base.repo.bak

Then clear your CentOS-Base.repo file

Method:> CentOS-Base.repo

Vi CentOS-Base.repo

[Base]

Name = CentOS5.3-base

Baseurl = http: // 172.16.17.140/i386/

Enable = 1

Gpgcheck = 1

Gpgkey = http: // 172.16.17.140/i386/RPM-GPG-KEY-CentOS-5

That's all.

The following is the test...

Run yum clean all first

Then verify

 

[Root @ centos yum. repos. d] # yum install gcc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Base | 1.1 kB

Base/primary | 912 kB: 00

Base 2599/2599

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package gcc. i386. 1.2-48. el5 set to be updated

--> Processing Dependency: libgomp> = 4.1.2-48. el5 for package: gcc

--> Processing Dependency: glibc-devel> = 2.2.90-12 for package: gcc

--> Running transaction check

---> Package glibc-devel.i386. 5-49 set to be updated

--> Processing Dependency: glibc-headers = 2.5-49 for package: glibc-devel

--> Processing Dependency: glibc-headers for package: glibc-devel

---> Package libgomp. i386. 4.0-6. el5 set to be updated

--> Running transaction check

---> Package glibc-headers.i386. 5-49 set to be updated

--> Processing Dependency: kernel-headers> = 2.2.1 for package: glibc-headers

--> Processing Dependency: kernel-headers for package: glibc-headers

--> Running transaction check

---> Package kernel-headers.i386. 6.18-194. el5 set to be updated

--> Finished Dependency Resolution

 

Dependencies Resolved

 

========================================================== ========================================================== ====================================

Package Arch Version Repository Size

========================================================== ========================================================== ====================================

Installing:

Gcc i386 4.1.2-48. el5 base 5.2 M

Installing for dependencies:

Glibc-devel i386 2.5-49 base 2.0 M

Glibc-headers i386 2.5-49 base 601 k

Kernel-headers i386 2.6.18-194. el5 base 1.0 M

Libgomp i386 4.4.0-6. el5 base 70 k

 

Transaction Summary

========================================================== ========================================================== ====================================

Install 5 Package (s)

Upgrade 0 Package (s)

 

Total download size: 8.9 M

Is this OK [y/N]: y

Downloading Packages:

(1/5): libgomp-4.4.0-6.el5.i386.rpm | 70 kB

(2/5): glibc-headers-2.5-49.i386.rpm | 601 kB

(3/5): kernel-headers-2.6.18-194.el5.i386.rpm | 1.0 MB

(4/5): glibc-devel-2.5-49.i386.rpm | 2.0 MB

(5/5): gcc-4.1.2-48.el5.i386.rpm | 5.2 MB

Bytes ---------------------------------------------------------------------------------------------------------------

Total 14 MB/s | 8.9 MB

Warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

Base/gpgkey | 1.5 kB: 00

Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) "From http: // 172.16.17.140/i386/RPM-GPG-KEY-CentOS-5

Is this OK [y/N]: y

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: libgomp 1/5

Installing: kernel-headers 2/5

Installing: glibc-headers 3/5

Installing: glibc-devel 4/5

Installing: gcc 5/5

 

Installed:

Gcc. i386. 1.2-48. el5

 

Dependency Installed:

Glibc-devel.i386 0: 2. 5-49 glibc-headers.i386 0: 2. 5-49 kernel-headers.i386 0: 2. 6.18-194. el5

Libgomp. i386. 4.0-6. el5

 

Complete!

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.