CentOS yum install出现问题,Could not open/read file:///mnt/cdrom/repodata/repomd.xml

[root@host-10-0-0-9 ~]# yum install httpd 
Loaded plugins: fastestmirror, security 
Loading mirror speeds from cached hostfile 
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/cdrom/repodata/repomd.xml 
Trying other mirror. 
Setting up Install Process 
Resolving Dependencies 
--> Running transaction check 
---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be installed 
--> Processing Dependency: httpd-tools = 2.2.15-29.el6.centos for package: httpd-2.2.15-29.el6.centos.x86_64 
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-29.el6.centos.x86_64 
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-29.el6.centos.x86_64 
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-29.el6.centos.x86_64 
--> Running transaction check 
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed 
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed 
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed 
---> Package httpd-tools.x86_64 0:2.2.15-29.el6.centos will be installed 
--> Finished Dependency Resolution 

Dependencies Resolved 

================================================================================ 
Package Arch Version Repository Size 
================================================================================ 
Installing: 
httpd x86_64 2.2.15-29.el6.centos c6-media 821 k 
Installing for dependencies: 
apr x86_64 1.3.9-5.el6_2 c6-media 123 k 
apr-util x86_64 1.3.9-3.el6_0.1 c6-media 87 k 
apr-util-ldap x86_64 1.3.9-3.el6_0.1 c6-media 15 k 
httpd-tools x86_64 2.2.15-29.el6.centos c6-media 73 k 

Transaction Summary 
================================================================================ 
Install 5 Package(s) 

Total download size: 1.1 M 
Installed size: 3.6 M 
Is this ok [y/N]: y 
Downloading Packages: 


Error Downloading Packages: 
apr-1.3.9-5.el6_2.x86_64: failure: Packages/apr-1.3.9-5.el6_2.x86_64.rpm from c6-media: [Errno 256] No more mirrors to try. 
httpd-tools-2.2.15-29.el6.centos.x86_64: failure: Packages/httpd-tools-2.2.15-29.el6.centos.x86_64.rpm from c6-media: [Errno 256] No more mirrors to try. 
apr-util-ldap-1.3.9-3.el6_0.1.x86_64: failure: Packages/apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm from c6-media: [Errno 256] No more mirrors to try. 
httpd-2.2.15-29.el6.centos.x86_64: failure: Packages/httpd-2.2.15-29.el6.centos.x86_64.rpm from c6-media: [Errno 256] No more mirrors to try. 
apr-util-1.3.9-3.el6_0.1.x86_64: failure: Packages/apr-util-1.3.9-3.el6_0.1.x86_64.rpm from c6-media: [Errno 256] No more mirrors to try. 


师妹告诉我,是yum源的问题。解决方法是更换yum源,链接如下:

http://blog.csdn.net/ichsonx/article/details/8518420

http://blog.csdn.net/ichsonx/article/details/8518631


更新之后下载,报错:

 GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 

按照 http://blog.csdn.net/zouhao619/article/details/36870589 的方法将CentOS-Base.repo中的所有RPM-GPG-KEY-CentOS-5更改为RPM-GPG-KEY-CentOS-6并yum makecache后仍报同样的错误。
按照 http://www.cnblogs.com/jackluo/p/3598167.html 
rpm --import /etc/pki/rpm-gpg/RPM*
成功!


你可能感兴趣的:(linux)