Linux Yum Error Error:cannot retrieve repository metadata (Repomd.xml) for repository:base. Verify its path and try again

Source: Internet
Author: User
Tags gpg

Under Linux use yum command times wrong Error:cannot retrieve repository metadata (Repomd.xml) for repository ..., as shown below

[email protected] yum.repos.d]# Yum Makecache
Loaded Plugins:product-id, Refresh-packagekit, security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Repository base is listed more than once in the configuration
File:///media/repodata/repomd.xml: [Errno] Could not open/read file:///media/repodata/repomd.xml
Trying other mirror.
Error:cannot Retrieve repository metadata (Repomd.xml) for repository:base. Verify its path and try again
[[email protected] yum.repos.d]# ls/media-hl
total 3633166
dr-x------.   1 root root 8.0k sep 20:32 cdrom< /strong>
dr-xr-xr-x. Root root  8.0k jan 30  2013 rhel_6.4 x86_64 Disc 1
-rwxr-xr-x.  1 root root 3.5G Dec 16  2015  rhel-server-6.4-x86_64-dvd.iso

Please observe the error message, and you are prompted with errors:

File:///media/repodata/repomd.xml: [Errno] Could not open/read file:///media/repodata/repomd.xml

This means that the REPOMD file could not be found, which would result in the Yum command being unable to retrieve the repository metadata (translated, or understood to be unable to find the library); This file needs to be found by the Yum Command, which defaults to the/repodata/directory of the system installation CD;

Check the Yum configuration information and check the configured repo file under/etc/yum.repos.d/:

[Email protected]/]# cd/etc/yum.repos.d/
[Email protected] yum.repos.d]# ls-l
Total 8
Drwxr-xr-x. 2 root root 4096 Oct 02:04 Bak_repo
-rwxr-xr-x. 1 root root 162 Oct 01:36 Rhel-base.repo
[Email protected] yum.repos.d]# more Rhel-base.repo
[Base]
Name=redhat
baseurl=file:///media/
Enabled=1
Gpgcheck=0
Gpgkey=file:///media/rpm-gpg-key-redhat-release

Here is how to configure the local Yum source, for how to configure the Yum source, you can refer to:

Http://www.cnblogs.com/Wherebolezi/p/4626670.html

On the local yum configuration file, you can see Yum pointing to the local/media/file; The/media directory is as follows

[Email protected] yum.repos.d]# LS/MEDIA-HL
Total 3.5G
Dr-x------. 1 root root 2.0K Sep 20:32 CDROM
Dr-xr-xr-x. Root root 8.0K Jan rhel_6.4 x86_64 Disc 1
-rwxr-xr-x. 1 root root 3.5G Dec rhel-server-6.4-x86_64-dvd.iso

Through the above information, the/media directory does not exist in the Repomd.xml file, the file in rhel_6.4 x86_64 Disc 1; You can modify the Yum configuration to allow the system to find files

The modified contents are as follows (note the need for the \ Escape character before spaces in the directory):

[Base]
Name=redhat
Baseurl=file:///media/rhel_6.4\ x86_64\ disc\ 1
Enabled=1
Gpgcheck=0
Gpgkey=file:///media/rhel_6.4\ x86_64\ disc\ 1/rpm-gpg-key-redhat-release

Then cleanup: Yum Clean all

Yum Makecache

The results are as follows:

[email protected] yum.repos.d]# Yum Clean all
Loaded Plugins:product-id, Refresh-packagekit, security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Cleaning Repos:base
Cleaning up everything
[Email protected] yum.repos.d]#
[Email protected] yum.repos.d]#
[email protected] yum.repos.d]# Yum Makecache
Loaded Plugins:product-id, Refresh-packagekit, security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
base                                                                                                                                                                                | 3.9 kb     00:00 ...
base/group_gz                                                                                                                                                                      | 204 kb     00:00 ...
base/filelists_db | 3.7 MB 00:00 ...
base/primary_db                                                                                                                                                                    | 3.1 mb     00:00 ...
base/other_db                                                                                                                                                                      | 1.5 mb     00:00 ...
Metadata Cache Created

No Error:cannot retrieve ... Content, and no could not open/read file ... When the file is not opened, it indicates that the problem has been resolved

If the problem persists, you need to check to see if the installation disc matches the system itself, or if the Yum source matches the system version, and then perform a few more yum clean all--and Yum Makecache observations

Linux Yum Error Error:cannot retrieve repository metadata (Repomd.xml) for repository:base. Verify its path and try again

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.