How Linux mounts iso yum source in virtual machine

  
                

In a virtual machine, the Linux system needs to be configured to install a local yum source to connect to the external network. How to configure it? You can use local iso as the source. The following small series will introduce you how to mount the iso yum source in the virtual machine. Let's learn it together.

First, as the system will be mounted on the iso source.

The code is as follows:

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

or

mount -o loop /xxx/xxx. Iso /mnt/iso/

where /mnt/iso is a folder created locally beforehand.

Then copy the file iso.repo into the folder /etc/yum.repos.d

If there are other *.repo files in the /etc/yum.repos.d folder, Please delete it after backup.

The contents of iso.repo are as follows:

The 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 yum source

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

Installing packages with yum can automatically find the dependencies between packages and install them automatically in the order of dependencies, which is very convenient.

The above is the introduction of how to mount the iso yum source in Linux in the virtual machine. First, mount the iso as the source to the system, and then update the yum source, you can follow the packages, you learn Yet?

Copyright © Windows knowledge All Rights Reserved