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 /"
<Directory "/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) <centos-5-key@centos.org>" 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!