The basic workflow of yum server construction and configuration of YUM is as follows: SERVER: stores all RPM software packages on the server, and analyzes the dependency between each RPM file with relevant functions, record the data into files stored in a specific directory on the server. Client: If you need to install a software, download the dependency file recorded on the server (via WWW or FTP) and analyze the record data downloaded from the server, then obtain all the relevant software and download it all at a time for installation. My environment: CentOS release 5.5 (Final) 1. Install yum package my system is installed by default. If not, find the corresponding installation file. [Root @ localhost yum. repos. d] # rpm-q yumyum-3.2.22-26.el5.centos2. copy the RPM package [root @ localhost repodata] # pwd/media/CentOS_5.5_Final/repodata [root @ localhost repodata] # lltotal 17107-rw-r -- r -- 1 root 941644 May 6 2010 comps. xml-rw-r -- 1 root 3605890 May 6 2010 filelists.xml.gz-rw-r -- 1 root 11743815 May 6 2010 other.xml.gz-rw-r -- 1 root root 1221980 May 6 2010 primary.xml.gz-rw-r -- R -- 1 root 1296 May 6 2010 repomd. xml-r -- 1 root 1121 May 6 2010 TRANS. TBL [root @ localhost media] # cp-rf CentOS_5.5_Final // var/ftp/pub/3. install the createrepo package and rebuild the package dependency [root @ centos Server] # rpm-q createrepo package createrepo is not installed [root @ centos Server] # rpm-ivh createrepo-0.4.11-3.el5.noarch.rpm warning: createrepo-0.4.11-3.el5.noarch.rpm: header V3 DSA signature: NOKEY, k Ey ID 37017186 Preparing... ######################################## ### [100%] 1: createrepo ####################################### #### [2, 100%] [root @ localhost yum. repos. d] # rpm-q createrepocreaterepo-0.4.11-3.el5 [root @ localhost ftp] # createrepo/var/ftp/pub/CentOS_5.5_Final/500/3392-CentOS/tomcat5-servlet-2.4-api-javadoc-5.5.23-0jpp.7.el5_3.2.x86_64.r 706/3392-CentOS/jakarta-commons-collectio Ns-testframework-3.2-2jpp.3.x86_64.rp 2792/3392-CentOS/yum-NetworkManager-dispatcher-1.1.16-14.el5.centos.1.noarch.r 2851/3392-CentOS/jakarta-commons-collections-testframework-javadoc-3.2-2jpp.3. 3392/3392-CentOS/xsane-0.991-5.el5.x86_64.rpmSaving Primary metadataSaving file lists metadataSaving other metadata [root @ localhost repodata] # pwd/var/ftp/pub/CentOS_5.5_Final/repodata [root @ localho St repodata] # lltotal 16408-rw-r -- r -- 1 root 941644 Jun 13 19:33 comps. xml-rw-r -- 1 root 3561694 Jun 13 filelists.xml.gz-rw-r -- 1 root 11045736 Jun 13 other.xml.gz-rw-r -- 1 root root 1209861 Jun 13 primary.xml.gz-rw-r -- 1 root 951 Jun 13 repomd. xml-r -- 1 root 1121 Jun 13 :33 TRANS. TBL found that some files have been updated. 4. build an ftp or apach environment (this step can be ignored if the Server and client are the same machine) [root @ centos Server] # rpm-ivh vsftpd-2.0.5-16.el5.i386.rpm warning: vsftpd-2.0.5-16.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ######################################## ### [100%] 1: vsftpd ####################################### #### [100%] [root @ centos Server] # chkconfig vsftpd on [root @ centos Server] # chkconfig vsftpd -- list Vsftpd 0: off 1: off 2: on 3: on 4: on 5: on 6: off [root @ centos Server] # service vsftpd restart Shutting down vsftpd: [FAILED] Starting vsftpd for vsftpd: [OK] [root @ centos Server] #5. the client must modify the YUM configuration file when each client uses YUM. Let's first look at the file:/etc/yum. repos. d/*. repo. The file name can be defined at will, but the extension must be repo. [root @ localhost yum. repos. d] # cat CentOS-Base.repo [base] name = CentOS-$ releasever-Base # Release List = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS # baseurl = repository []: contains the repository name, which is unique. Name: Repository description. baseurl: YUM source address. FTP, HTTP, and FILE are configured here. Enabled: whether to enable this repository. 1 is for use, 0 is for disable gpgcheck: whether to check the GPG signature (verify whether the package to be installed is officially REDHAT ). [Root @ localhost yum. repos. d] # yum updateLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileSetting up Update ProcessResolving Dependencies --> Running transaction check ---> Package telnet. x86_64 1:0. 17-39.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================== ========================================================== ==================================== ============================== Package Arch Version Repository Size ==== ========================================================== ========================================================== ========================================================== ===== Updating: telnet x86_64 1:0. 17-39.el5 base 59 k Transaction Summary ================================== ========================================================== ========================================================== ==================== Install 0 Package (s) Upgrade 1 Package (s) Total download size: 59 kIs this OK [y/N]: yDownloading Packages: Running rpm_check_debugRunning Transaction TestFinished Transaction Test Transaction Check Error: file/usr/share/man/man1/telnet.1.gz from install of telnet-0.17-39.el5.x86_64 conflicts with file from package telnet-0.17-31.EL4.3.i386 Error Summary ------------- telnet package Error when executing yum update, because I forced downgrade of tel before. Net service, which is ignored here. Try to install a new package gd-devel. The package gd-devel and all dependent packages are successfully installed! [Root @ localhost yum. repos. d] # yum install-y gd-develLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileSetting up Install ProcessResolving Dependencies --> Running transaction check ---> Package gd-devel.i386 0: 2. 0.33-9.4.el5 _ 4.2 set to be updated --> Processing Dependency: freetype-devel for package: gd-devel --> Processing Dependency: libpng-devel for package: gd-devel --> Proces Sing Dependency: libXpm-devel for package: gd-devel --> Processing Dependency: libX11-devel for package: gd-devel --> Processing Dependency: libjpeg-devel for package: gd-devel --> Processing Dependency: libgd. so.2 for package: gd-devel --> Processing Dependency: fontconfig-devel for package: gd-devel ---> Package gd-devel.x86_64 0: 2. 0.33-9.4.el5 _ 4.2 set to be updated --> Running transaction check ---> P Ackage fontconfig-devel.x86_64 0: 2. 4.1-7. el5 set to be updated -----> Package freetype-devel.x86_64 0: 2. 2.1-21. el5_3 set to be updated ---> Package gd. i386 0: 2. 0.33-9.4.el5 _ 4.2 set to be updated --> Processing Dependency: libXpm. so.4 for package: gd ---> Package libX11-devel.x86_64. 0.3-11. el5 set to be updated --> Processing Dependency: xorg-x11-proto-devel> = 7.1-2 for package: libX11-dev el --> Proc Essing Dependency: libXau-devel for package: libX11-devel --> Processing Dependency: libXdmcp-devel for package: libX11-devel ---> Package libXpm-devel.x86_64 0: 3. 5.5-3 set to be updated ---> Package libjpeg-devel.x86_64 0: 6b-37 set to be updated ---> Package libpng-devel.x86_64. 2.10-7.1.el5 _ 3.2 set to be updated --> Running transaction check ---> Package libXau-devel.x86_64. 0.1-3.1 set to be up Dated ---> Package libXdmcp-devel.x86_64. 0.1-2.1 set to be updated ---> Package libXpm. i386 0: 3. 5.5-3 set to be updated ---> Package xorg-x11-proto-devel.x86_64. 1-13.el5 set to be updated --> Processing Dependency: mesa-libGL-devel for package: xorg-x11-proto-devel --> Running transaction check ---> Package mesa-libGL-devel.x86_64 0: 6. 5.1-7.8.el5 set to be updated --> Finished Dependency resolti On Dependencies Resolved ====================================== ========================================================== === Package Arch Version Repository Size ============================== ========================================================== ========= Installing: gd-devel i386 2.0.33-9.4.el5 _ 4.2 base 97 k gd-devel x86_64 2.0.33-9.4.el5 _ 4.2 base 102 kInstalling for dependencies: fontconfig-devel x86_64 2.4.1-7. el5 base 168 k fr Eetype-devel x86_64 2.2.1-21. el5_3 base 146 k gd i386 2.0.33-9.4.el5 _ 4.2 base 154 k libX11-devel x86_64 1.0.3-11. el5 base 661 k libXau-devel x86_64 1.0.1-3.1 base 11 k libXdmcp-devel x86_64 1.0.1-2.1 base 7.5 k libXpm i386 3.5.5-3 base 45 k libXpm-devel x86_64 3.5.5-3 base 32 k libjpeg-devel x86_64 6b-37 base 105 k libpng-devel x86_64. 2.10-7.1.el5 _ 3.2 base 184 k mesa-libGL-devel x86_64 6.5.1-7. 8. el5 base 461 k xorg-x11-proto-devel x86_64 7.1-13. el5 base 247 k Transaction Summary ==================================== ========================================================== ====== Install 14 Package (s) upgrade 0 Package (s) Total download size: 2.4 MDownloading Packages: bytes Total 43 MB/s | 2.4 MB 00: 00 Running rpm_check_debugRunning Trans Action TestFinished Transaction TestTransaction Test SucceededRunning Transaction Installing: libXpm 1/14 Installing: freetype-devel 2/14 Installing: fontconfig-devel 3/14 Installing: libjpeg-devel 4/14 Installing: libpng-devel 5/14 Installing: libXau-devel 6/14 Installing: gd 7/14 Installing: xorg-x11-proto-devel 8/14 Installing: libX11-devel 9/14 Installing: libXpm-devel 10/14 Installi Ng: libXdmcp-devel 11/14 Installing: gd-devel 12/14 Installing: gd-devel 13/14 Installing: mesa-libGL-devel 14/14 Installed: gd-devel.i386 0: 2. 0.33-9.4.el5 _ 4.2 gd-devel.x86_64 0: 2. 0.33-9.4.el5 _ 4.2 Dependency Installed: fontconfig-devel.x86_64 0: 2. 4.1-7. el5 freetype-devel.x86_64 0: 2. 2.1-21. el5_3 gd. i386 0: 2. 0.33-9.4.el5 _ 4.2 libX11-devel.x86_64. 0.3-11. el5 libXau-devel.x86_64. 0.1-3.1 libX Dmcp-devel.x86_64. 0.1-2.1 libXpm. i386 0: 3. 5.5-3 libXpm-devel.x86_64 0: 3. 5.5-3 libjpeg-devel.x86_64 0: 6b-37 libpng-devel.x86_64 2:1. 2.10-7.1.el5 _ 3.2 mesa-libGL-devel.x86_64. 5.1-7.8.el5 xorg-x11-proto-devel.x86_64. 1-13.el5 Complete!