centos7 local mount yum repository

1. Before the experiment first save snapshots

 

 

 2. First of all we want to switch to "/etc/yum.repos.d/" directory (the directory store because the yum repository configuration files)

 

 

 3. created using vim editor and open a named rhel7.repo new file name can be customized, but the suffix is necessary .repo , itemized write configuration parameters, and save and exit.

Parameters are as follows:

[Rhel7]

name=rhel7

baseurl = file: /// media / cdrom

enabled=1

gpgcheck=0

 

 

 

4. Enter the command:

# mkdir -p /media/cdrom

Before executing the next command, we must first check if you set the correct disk mirroring, because the author did not import the disk image there is a mistake. Check method is to look at your own virtual CD icon in the lower right corner of the machine if the green light, green light, if you can continue to the next command if there is no green light, remember to download centos7 mirror, and choose the correct image directory in the settings, click OK, look at the disk icon turns green before proceeding.

 

 

 

5. Enter the command:

# mount /dev/cdrom /media/cdrom

The system will prompt:

mount: /dev/sr0 is write-protected, mounting read-only

6. Enter the command:

 

# vim /etc/fstab

I in the interface by entering the edit mode, the last parameter is added so that the text line

/dev/cdrom /media/cdrom iso9660 defaults 0 0

 

 

 Save and exit.

7. Turn yum, yum first performed in

#ifdown ifcfg-ens33

Then execute:

#ifup ifcfg-ens33

8. The input command:

# yum install httpd

If the connection fails may try several times, restart yum repeated, re-entering the input terminal centos7 instruction.

If the connection is successful, then all the way down appeared to perform complete! Or complete! The completion of the experiment.

 

Guess you like

Origin www.cnblogs.com/hanshuohao/p/11683256.html