Configure the local yum source and redhatyum for Redhat HAT in VMware

Source: Internet
Author: User

Configure the local yum source and redhatyum for Redhat HAT in VMware
Configure local yum source for Redhat HAT in VMware

Today, we are going to use CM to install the big data environment. It only takes several machines to use the same yum source. Therefore, we want to copy the Redhat image file to the virtual machine and stop using it, finally, share it with other virtual machines through http. After that, it's really silly to do this. First, I have suspended the image once when installing the virtual machine, so I just need to suspend it in every virtual machine, you can directly configure the yum source without copying iso to the virtual machine to reduce disk usage. So now let's talk about how to do it:

1. Check Before installation. First, make sure that your VM has loaded a local image, as shown in:

 

Note:Select the location of the file you used when installing the system from the ISO image file. Check the status to indicate that you have imported the CD. Check whether the file is successfully imported. Check whether the/media/directory contains the RHEL_6.4 x86_64 Disc 1 file (Redhat is used here). If yes, the import is successful.

If there is nothing under the/media/directory, it may be that the ISO has not been suspended. You can use the following command to manually suspend it:

 

Mount/dev/sr0/media/cdrom or mount/dev/sr1/media/cdrom

 

Ii. Configure the yum Source

1. log on to the system as the root user and create the cdrom folder in any directory. The name can be customized. the root user is the cdrom folder created in the/mnt folder.

 

#    mkdir /mnt/cdrom

 

2. Execute the following command in any directory:

# mount -o loop /dev/cdrom /mnt/cdrom/

It should be noted that/dev/cdrom was created when I installed the system and used for mounting the image file. Now it is also mounted to/mnt/cdrom. If the preceding command is successfully executed, the files in the/mnt/cdrom/directory are exactly the same as those in the/media/RHEL_6.4 x86_64 Disc 1/directory, proving that the load is successful.

3. modify the configuration file of the yum source. We recommend that you set/etc/yum. repos. d/delete all files in the directory and create a new one. the command is as follows:

# cd /etc/yum.repos.d/# rm -rf *# touch yum.repo# vim yum.repo 

Copy the following content to the yum. repo file.

[rhel]name =Red Hat enterprise Linux 6baseurl=file:///mnt/cdromenable=1gpgkey=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

Briefly explain the meaning of the Configuration:

[Rhel]
Name = Red Hat enterprise Linux 6 # name
Baseurl = file: // mnt/yumsrc/# specify the file where the yum source is located and the file where the software package is located
Enable = 1 # The value must be 1, indicating that it is enabled.
Gpgkey = 1 # indicates version number check
Gpgkey = file: // mnt/cdrom/RPM-GPG-KEY-redhat-release # indicates the check path of the version number.

 

4. After the above configuration is Complete, the yum source has been configured. Next, you can test the command: yum install gpm and press enter to see the Complete! Indicates that gpm has been successfully installed using the yum source, and the installation is successful.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.