When configuring Centos-6.0-x86_64-bin-dvd2.iso as the local Yum source, there are quite a few problems:
-----------------------------------------Question one------------------------------------------
Mount the Centos-6.0-x86_64-bin-dvd2.iso on the/mnt and configure the local Yum Source:
- #mount/root/centos-6.0-x86_64-bin-dvd2.iso/mnt-o Loop
- #vi/etc/yum.repos.d/software.repo
- [Software]
- Name=software
- Baseurl=file:///mnt
- EnablEd=1
- Gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6
- #yum repolist
Then the error is-_-!, the wrong information is almost:
File:///mnt/repodata/repomd.xml: [Errno] Could not open/read file:///mnt/repodata/repomd.xml. Mistake from BaseURL does not contain the Repodata directory
Why the problem occurred:
Centos-6.0-x86_64-bin-dvd2.iso This image does not contain Yum's package index database Repomd.xml, which is typically placed in the Repodata folder. Therefore, without special tools, the packages contained in this centos-6.0-x86_64-bin-dvd2.iso cannot be used as a local source of Yum alone.
-----------------------------------------question two------------------------------------------
In my CentOS-6, the/etc/yum.repos.d/directory itself already has 3 already built repo library, is base, Media, Debug.
I create a new Software.repo myself, using the Centos-6.0-x86_64-bin-dvd1.iso image, which contains the Repodata file.
But no matter how I adjust the settings, with the Yum repolist command , the packages contained in the ISO are not found, and the enableD value in all the. Repo is set to 1, but using Yum Repolist prompts the error:
Could not retrieve mirrorlisthttp://mirrorlist.centos.org/?release=6&arch=x86_64&repo=centosplus error was:Pycurl ERROR 6-"couldn ' t resolve Host ' mirrorlist.centos.org '"Error:cannot Retrieve repository metadata (Repomd.xml) for Repository:centosplus.verify its path and try again
Workaround: To use your own newly created Yum Local source, the. Repo Library provided by the system itself is temporarily set to Disabled (Enabled=0), in which case the Yum repolist can be used to properly search the local package library provided by ISO.
Attached: Steps to establish a local Yum Source:
1. Mount the ISO image with the package and the corresponding Repodata index in a directory (I put it under/mnt)
2, create your own configuration file under/etc/yum.repos.d/(for example, Software.repo), must use the. Repo end, the content is:
- [software] //software is the configuration name
- name=SOFTWARE 
- baseurl=file:///mnt/ //because it is a local source, it is file://, which points to the parent directory of the Software library and Repodata
- enabled=1 //activating this configuration
- gpgcheck=0 //does not carry out GPG check
3. Set the Enabled key value of other configuration files to 0 in the yum.repos.d/directory, otherwise it will interfere with the configuration file that you set up when executing sequentially.
CentOS Yum Source problem