当前位置:网站首页>Centos7 local source Yum configuration

Centos7 local source Yum configuration

2020-11-10 10:41:00 osc_mxz6aybo

CentOS7 Local sources yum To configure

  • Use software VMware Workstation 16pro
  • System CentOS 7
  • Image file CentOS-7-x86_64-DVD-1511.iso

CentOS After the system is installed on the virtual machine or the real machine , There are two ways to install software , Except for local sources yum install , And network installation , But sometimes there are some errors when using network installation , Therefore, it is recommended to set the local source configuration first .

After opening the virtual machine, connect to download or install the image files of the system in the settings

 Ah, wake up Note that when the image is successfully connected to the virtual machine , The lower right corner of the virtual machine shows
 Ah, wake up open CentOS The terminal input of

  • notes : After opening the terminal, it is recommended to switch to root In user mode
su  root
df -h  # View mounted devices 

 Ah, wake up

  • /dev/sr0 It's the device name of the image hinder run/media/root/… Is the default mount path of the image We need to reset the mount path
  • First in mnt Create under directory cdrom, Then mount the image to cdrom Next
mount /dev/sr0 /mnt/cdrom/
  • After the mount is successful, it will be shown as shown in the figure

 Ah, wake up

  • Set mount and enter cd /etc/yum.repos.d/ Under the table of contents
vi CentOS-Media.repo 
 Edit the file, copy the contents and exit 

Use rm -f * Delete all files

 Insert picture description here
And then create your own .reop The documents are as follows
 Insert picture description here

# The document code is as follows 
[a] # Two places here a Is the name of the created file 
name=a
baseurl=file:///mnt/cdrom/  # Here is the mounted Directory 
gpgcheck=0    # Is not enabled 
enabled=1  # verification gpg Don't open 
# Then save to exit 

Because it's reset yum The following commands are used to configure all of them

yum clean alll # Clear all yum To configure 
yum makecache # establish yum New cache 

Success will be shown as follows
 Ah, wake up
Finally, query the installed software package yum list

 Ah, wake up Here we are CentOS Local sources yum Configuration complete

版权声明
本文为[osc_mxz6aybo]所创,转载请带上原文链接,感谢