The method of configuring Local yum Source in Linux system
This article mainly explains "the method of configuring local yum source in Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Linux system configuration of local yum sources" bar!
Prepare:
System: Centos 6.5
Tool: system image file of Centos 6.5
First, copy the system image file to the Linux system and put it in the specified location, this time under the / root directory.
[root@local ~] # lsCentOS-6.5-x86_64-bin-DVD1.iso
Second, create a mount point and mount the system image file.
[root@local ~] # mkdir / media/cd [root@local ~] # mount-o loop / root/CentOS-6.5-x86_64-bin-DVD1.iso / media/cd [root@local ~] # df-hFilesystem Size Used Avail Use% Mounted on/dev/sda3 41G 4.8G 35G 13% / tmpfs 932M 228K 932m 1% / dev/shm/dev/sda1 504M 45M 434M 10% / boot/dev/sr0 4.2g 4.2g / media/cd
Modify the configuration file. The location and content of the configuration file are as follows
Ps: the centos system has multiple yum configuration files in this directory, leaving only one local yum configuration.
[root@local ~] # cd / etc/yum.repos.d/ [root@local yum.repos.d] # ls CentOS-Media.repo [root@local yum.repos.d] # cat CentOS-Media.repo# CentOS-Media.repo## This repo can be used with mounted DVD media, verify the mount point for# CentOS-6. You can use this repo and yum to install items directly off the# DVD ISO that we release.## To use this repo, put in your DVD and use it with the other repos too:# yum-enablerepo=c6-media [command] # # or for ONLY the media repo, do this:## yum-- disablerepo=\ *-- enablerepo=c6-media [command] [c6-media] name=CentOS-$releasever-Mediabaseurl= file:///media/CentOS_6.5_Final/gpgcheck=0enabled=1
Clear the original yum cache and re-cache the configured local yum source.
[root@local yum.repos.d] # yum clean allLoaded plugins: fastestmirror, refresh-packagekit, securityCleaning repos: c6-mediaCleaning up EverythingCleaning up list of fastest mirrors [root@local yum.repos.d] # yum repolistLoaded plugins: fastestmirror, refresh-packagekit, securityDetermining fastest mirrorsc6-media | 4.0 kB 00:00. C6-media/primary_db | 4.4 MB 00:00... Repo id repo name statusc6-media CentOS-6-Media 6367repolist: 6367
At this point, the local yum source configuration is complete!
At this point, I believe that everyone on the "Linux system configuration of local yum source method" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!