Http://www.cnblogs.com/kerrycode/p/4723637.html
Yum is the abbreviation for Yellow Dog Updater modified, originally developed by the developer Terra Soft, a release of Yellow Dog, written in Python, then called yup (Yellow Dog Updater), followed by Duke University's [Email protected] The development team has made improvements, hence the name. Yum's mission is to automate upgrades, install/remove RPM packages, collect information about RPM packages, check dependencies and automatically prompt users to resolve them. Yum's key is to have a reliable repository, as the name implies, this is the repository of software, it can be an HTTP or FTP site, can also be a local software pool, but must contain the RPM header, header includes the RPM package of various information, including description, function, Provide files, dependencies, etc. it is by collecting these headers and analyzing them that the remaining tasks can be completed automatically.
If you have experienced the pain of installing RPM, I believe it is definitely 100% choose yum instead of RPM. Yum is easy to use. If you want to use RPM you must configure repository (software warehouse), because Rhel's yum online update is charged, if not registered, if not to use, if you want to install some packages with Yum, you need to configure the local Yum source. Here's how to configure this, with red Hat Enterprise Linux Server release 6.6 as the experimental scenario. There may be a slight difference between different versions of Linux.
One: Mount the local CD-ROM to the system
If the server is a virtual machine, you can enter the control platform via vsphere client and specify the ISO image file for the operating system in edit settings--Hardware and CD/DVD drive. If it is a physical machine, you need to enter the room to find the server, the CD-ROM into the installation CD. This is relatively troublesome, so it is generally better to copy the disc file to the local hard disk.
Method 1: Optical Drive mount Image
[Email protected] ~]# Mkdir/mnt/cdrom
[Email protected] ~]# mount-t Iso9660/dev/cdrom/mnt/cdrom
Mount:block Device/dev/sr0 is write-protected, mounting read-only
Method 2: Copy the disc file
The file/tmp/rehl6.tar.gz is copied from the CD-ROM package and is extracted to the specified directory/mnt/cdrom
[Email protected] ~]# mkdir/mnt/cdrom/
[Email protected] ~]tar zxvf/tmp/rehl6.tar.gz-c/mnt/cdrom/
Two: Configure local Yum source
[Email protected] ~]# cd/etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
Redhat.repo Rhel-source.repo
[Email protected] Yum.repos.d]touch Rhel-media.repo
[Media]
Clear Old Cache
[email protected] ~]# Yum Clean all
Loaded Plugins:product-id, Security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Cleaning Repos:media
Cleaning up everything
Get Yum List
Verify that the Yum configuration is successful
[email protected] ~]# Yum Makecache
Loaded Plugins:product-id, Refresh-packagekit, security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Metadata Cache Created
Verify that the Yum configuration is successful
[email protected] ~]# Yum grouplist | grep Server
Network Infrastructure Server
Server Platform
Web Server
Backup Server
Directory Server
Identity Management Server
Network Storage Server
Print Server
Server Platform Development
Minor problem:
In the Yum configuration file, if you forget to add the name of the Yum source, the following error may be reported.
[email protected] yum.repos.d]# Yum Clean all
Loaded Plugins:product-id, Security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Error:file contains no section headers.
File:file:///etc/yum.repos.d/rhel-media.repo, Line:1
' name=red Hat Enterprise Linux 6.6 \ n '
RedHat Linux RHEL6 Configure local Yum source