[Statement]: This article can be reproduced at will, but please indicate the source: http://www.cnblogs.com/hanxi/
The Linux system I installed is Oracle Linux, which is fully called Oracle Enterprise Linux. Is downloaded from the Donkey: http://www.verycd.com/topics/2888648/
The following method is successful.
1.Create a directory for storing ISO images or Cd content
[Root @ hanxi-workstation hanxi] #Mkdir/home/hanxi/yum
And copy all the files in the CD media or ISO image file to the Created directory (/Home/hanxi/yum).
For a CD, run the following command:
[Root @ hanxi-workstation hanxi] #CP-r/Media/CDROM/home/hanxi/yum
PS:/Media/CDROMIs the directory of the Mount Optical Drive.
I am using an ISO image file, so I copied the file directly with the mouse/Home/hanxi/yum
PS: All files in the ISO file, not the ISO file.
This is the case after the replication is complete, as shown in figure
2.Install createrepo
Createrepo is the configuration tool for configuring the yum source. Check whether the createrepo package has been installed:
[Root @ hanxi-workstation hanxi] # Rpm-Qa | grep createrepo
If it is not installed, run the following command to complete the installation:
[Root @ hanxi-workstation hanxi] #Rpm-IVH
/Home/hanxi/Yum/packages/createrepo-0.9.8-4.el6.noarch.rpm
PS: The version varies depending on the operating system version. Find the current system's createrepo version RPM package for installation. You can go/Home/hanxi/Yum/packages/Folder search, such:
3.Create XML-rpm-metadata for Yum Repository
Run the following command:
[Root @ hanxi-workstation hanxi] #Createrepo-G
/Home/hanxi/Yum/Server/repodata/repomd. xml
/Home/hanxi/Yum/Server/
[Root @ hanxi-workstation hanxi] #Createrepo-G
/Home/hanxi/Yum/highavailability/repodata/repomd. xml
/Home/hanxi/Yum/highavailability/
[Root @ hanxi-workstation hanxi] #Createrepo-G
/Home/hanxi/Yum/loadbalancer/repodata/repomd. xml
/Home/hanxi/Yum/loadbalancer/
[Root @ hanxi-workstation hanxi] #Createrepo-G
/Home/hanxi/Yum/resilientstorage/repodata/repomd. xml
/Home/hanxi/Yum/resilientstorage/
PS: Each of the preceding commands may take some processing time. Be sure to wait, for example:
After the createrepo command is executed, the system automatically scans the related directories and adds the RPM package to the database of the yum source.
4.Create a repo file for the local Yum Client
Configure the local Yum Repository:
[Root @ hanxi-workstation hanxi] #CD/etc/yum. Repos. d/
[Root @ hanxi-workstation yum. Repos. d] # Gedit local. Repo
PS: The name can start at will,. RepoSuffix
Add the following content to the file:Save the following content:
[Highavailability]
Name = highavailability
Baseurl = File: /Home/hanxi/Yum/highavailability
Enabled = 1
Gpgcheck = 0
Gpgkey = File: /Home/hanxi/Yum/rpm-GPG-key-Oracle
[Loadbalancer]
Name = loadbalance
Baseurl = File: /Home/hanxi/Yum/loadbalancer
Enabled = 1
Gpgcheck = 0
Gpgkey = File: /Home/hanxi/Yum/rpm-GPG-key-Oracle
[Resilientstorage]
Name = resilientstorage
Baseurl = File: /Home/hanxi/Yum/resilientstorage
Enabled = 1
Gpgcheck = 0
Gpgkey = File: /Home/hanxi/Yum/rpm-GPG-key-Oracle
[Server]
Name = Server
Baseurl = File: /Home/hanxi/Yum/Server
Gpgcheck = 0
Enabled = 1
Gpgkey = File: /Home/hanxi/Yum/rpm-GPG-key-Oracle
For example:
5. test the use of Yum to install the software package
You can click the following menu path to openAdd/delete Software: System --> Management -->Add/delete Software
Now you can search for software in the search box...
++ ++ ++
Bytes -----------------------------------------------------------------------------------------------------------------
++ ++
-------------------------------------------------------------
++
Little experience, share and share happiness together
!!!!!!!!!!!!!!!!!!