1. why is it necessary to build a local YUM source to upgrade and install software online using the YUM client tool on a Linux host due to network connection speed and network bandwidth restrictions, installation is often unnecessary for users. However, if a local YUM source server is built in the LAN, the software installation speed is slow. 2. How to build a local YUM Source
1. Why should I build a local YUM source?
When you use the YUM client tool on a Linux host to upgrade and install software online, the installation may be unnecessary because of network connection speed and bandwidth restrictions. However, if a local YUM source server is built in the LAN, the software installation speed is slow.
2. How to build a local YUM Source
Idea: You can obtain the required rpm package from the rhel6 installation disc and use the HTTP or FTP protocol to build a YUM source server on the local LAN.
Steps
(1) install the createrepo Tool
Createrepoa is mainly used to collect the header information of rpm package files in the directory to create repodata software repository data (xml files compressed by gzip ).
Mount/dev/cdrom/media/cdrom // mount the disc
Rpm-ivh/media/cdrom/Packages/createrepo-0.9.8-4.el6.noarch.rpm
(2) install the FTP server
Rpm-ivh/media/cdrom/Packages/vsftpd
(3) configure the software warehouse directory
Refer to the Server directory of the installation CD
Mkdir/var/ftp/pub/Packages
Mkdir/var/ftp/pub/repodata
Copy all RPM Packages from the CD to the/var/ftp/pub/Packages directory (Ensure that the hard disk has sufficient disk space)
Cp-rv/media/cdrom/Packages/*/var/ftp/pub/Packages/
(3) create a software Warehouse Information File
Cd/var/ftp/pub/
Createrepo -- database ./
[Root @ server pub] # ls repodata/
Filelists.sqlite.bz2 other.sqlite.bz2 primary.sqlite.bz2 repomd. xml
Filelists.xml.gz other.xml.gz primary.xml.gz
The corresponding software warehouse information file has been created.
(4) Start the vsftpd service
Service vsftpd start
Chkconfig -- level 35 vsftpd on
(5) Test on another client. First, create a repo file to specify the YUM source location.
Vi/etc/yum. repos. d/server1.repo. Note that the file extension must end with a repo. The file content is as follows:
[Rhel6] // name of the software Repository
Name = rhel6 // description of the software Repository
Baseurl = ftp: // 192.168.100.1/pub // location of the software Repository
Enabled = 1 // whether to use the software Repository
Gpgcheck = 1 // check the GPG signature (used to verify whether the package to be installed is officially RedHat)
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release GPG signature KEY location
Install samba using yum client tools
[Root @ mail ~] # Yum-y install samba *
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package samba-winbind-clients-3.5.4-68.el6.x86_64 already installed and latest version
Package samba-common-3.5.4-68.el6.x86_64 already installed and latest version
Package samba-client-3.5.4-68.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package samba. x86_64. 5.4-68. el6 set to be updated
---> Package samba-winbind.x86_64. 5.4-68. el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
========================================================== ========================================================== ===
Package Arch Version Repository Size
========================================================== ========================================================== ===
Installing:
Samba x86_64 3.5.4-68. el6 rhel6 5.0 M
Samba-winbind x86_64 3.5.4-68. el6 rhel6 3.6 M
Transaction Summary
========================================================== ========================================================== ===
Install 2 Package (s)
Upgrade 0 Package (s)
Total download size: 8.6 M
Installed size: 30 M
Downloading Packages:
(1/2): samba-3.5.4-68.el6.x86_64.rpm | 5.0 MB
(2/2): samba-winbind-3.5.4-68.el6.x86_64.rpm | 3.6 MB
Bytes -----------------------------------------------------------------------------------
Total 25 MB/s | 8.6 MB
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: samba-winbind-3.5.4-68.el6.x86_64 1/2
Installing: samba-3.5.4-68.el6.x86_64 2/2
Installed:
Samba. x86_64 3. 5.4-68. el6 samba-winbind.x86_64. 5.4-68. el6
Complete!
Check whether the samba software package is correctly installed.
[Root @ mail ~] # Rpm-qa | grep samba
Samba-3.5.4-68.el6.x86_64
Samba-client-3.5.4-68.el6.x86_64
Samba-winbind-clients-3.5.4-68.el6.x86_64
Samba-common-3.5.4-68.el6.x86_64
Samba-winbind-3.5.4-68.el6.x86_64
Success. I will explain how to use the yum tool later.
Rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release import signature KEY