|
Off the net, and no way want to download something, then play the next yum configuration local sources. In fact, it would not, the Internet search, summed up the following two ways:
A. Install the software by CentOS DVD, CD software, which provides enough to satisfy our need for it, and the DVD version of the software is stable version, faster download speeds, learning CentOS, the DVD will CentOS yum source can be used as the default greatly improve learning efficiency.
I was CentOS
6.4 using a virtual machine, the virtual machine to load CD method: VM -> Removable Devices -> CD / DVD-> Settings, choose a good CD.
Start down the steps:
1. [root @ localhost
~] # Mkdir / media / CentOS // Create a directory to mount the CD-ROM
2. [root @ localhost
~] #mount / Dev / cdrom / mnt / centos // mount
3. [root @ localhost
yum.repos.d] # mv CentOS-Base.repo CentOS-Base.repo.bak // use yum network update mode, simply default choice for CentOS-Base.repo renamed CentOS-Base.repo.bak i.e. can
4. [root @ localhost
~] # Vim /etc/yum.repos.d/CentOS-Media.repo // Configure the local source
will
[C6-media]
name = CentOS- $ releasever - Media
baseurl = file: /// media / CentOS /
file: /// media / cdrom /
file: /// media / cdrecorder /
gpgcheck = 1
enabled = 0
change into
[C6-media]
name = CentOS- $ releasever - Media
baseurl = file: /// media / CentOS /
gpgcheck = 1
enabled = 1
Wherein baseurl modify the DVD mount directory, enabled = 1 enable local update mode
: Wq to save and exit
6. [root @ localhost
~] # Yum clean all // clear the existing yum information
7. [root @ localhost
yum.repos.d] # yum list // Check the list of DVD software
So later on DVD to install the software using the default, if you want to restore the network installation mode,
CentOS-Base.repo.bak reduction can be renamed.
PS. After each reboot the system need to manually mount the DVD to / media / CentOS /, if you can be bothered to write your own script to automatically mount.
Two. 1. [root @ localhost ~] # mkdir yumload // create folders stored rpm package
2.
[Root @ localhost ~] # cp / media / CentOS / Packages / yumload / // copy past
3.
Then create a local repo use createrepo instruction, CentOS6 createrepo not installed by default, you need to manually install, it does not matter, in our DVD disc has integrated createrepo packet, if packets need to rely on other installation packages, and then click install.
[Root @ localhost
Packages] # rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
error:
Failed dependencies:
python-deltarpm is needed by createrepo-0.9.9-17.el6.noarch // This message may appear, do not worry
[Root @ localhost
Packages] # rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
error:
Failed dependencies:
deltarpm = 3.5-0.5.20090913git.el6 is needed by python-deltarpm-3.5-0.5.20090913git.el6.i686
[Root @ localhost
Packages] # rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm // find a step by step its dependencies
Preparing ...
########################################### [100%]
1: deltarpm ########################################### [100%]
[Root @ localhost
Packages] # rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
Preparing ... ########################################### [100% ]
1: python-deltarpm ########################################### [100 %]
[Root @ localhost
Packages] # rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
Preparing ...
########################################### [100%]
1: createrepo ########################################### [100%]
It will depend on the package complete. .
4. [root @ localhost ~] # createrepo yumload / # yum repository is created, patience
Spawning
worker 0 with 3114 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
5 .. /etc/yum.repo.d/ created under a repo file, the file name can be customized, but must end with repo and add about content:
[Linuxidc.org] # warehouse name can be customized
name = This is a local repo # description
baseurl = file: /// yumload / # here to fill warehouses url, note that there are three forward slashes
enabled = 1 # if the open warehouse, 1 is on, 0 is off
gpgcheck = 0 # Check whether gpgkey, 1 is on, 0 is off
6. local yum source here has been set up is completed, the next re-initialization yum cache:
[Root @ linuxidc repodata] # yum clean all
7. Test group information is correct can add the following code, as long as the output information on that success
[Root @ linuxidc ~] # yum grouplist |
|
|
|