How to use local iso as The yum source in linux in virtual machines

Source: Internet
Author: User
This article mainly introduces how linux uses local iso as The yum source in virtual machines. For more information, see

Linux in a virtual machine sometimes cannot connect to the internet. to facilitate the installation of various packages, we investigated how to configure local yum installation.

First, mount the iso as the source to the system.


Copy codeThe code is as follows:
Mount-o loop/dev/cdrom/mnt/iso/
Or
Mount-o loop/xxx. iso/mnt/iso/

/Mnt/iso is a folder created locally in advance.

Then, import the iso. repo file to the/etc/yum. repos. d folder.

If the folder/etc/yum. repos. d contains other *. repo files, back up the files and delete them.

The content of iso. repo is as follows:


Copy codeThe code is as follows:
[Iso]
Baseurl = file: // mnt/iso
Gpgkey = file: // mnt/iso/RPM-GPG-KEY-redhat-beta
Failovermethod = priority
Enabled = 1
Gpgcheck = 0

Finally, execute yum update to update the yum source.

After the update, you can use yum to install packages.

Using yum to install a package can automatically identify the dependencies between packages, and automatically install the package in the order of dependencies, which is very convenient.

Related Article

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.