yum命令YumRepo Error错误解决方法

    我在用yum安装xdm包的时候失败,错误信息如下:

[root@www ~]# yum install xdm
Loaded plugins: fastestmirror, security
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
adobe-linux-i386                                                                                                                                                                                                          | 2.9 kB     00:00     
adobe-linux-i386/primary_db                                                                                                                                                                                               | 2.7 kB     00:00     
http://linuxdownload.adobe.com/linux/i386/repodata/b67e9e035e538ac4bc09fcaf3a42083bd884e730511ea1637b746653b567b9cd-primary.sqlite.bz2: [Errno -3] Error performing checksum
Trying other mirror.
http://mirror.centos.org/centos/5/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.centos.org/centos/5/extras/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.centos.org/centos/5/updates/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package xorg-x11-xdm.i386 1:1.0.5-7.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================================================
 Package                                                       Arch                                                  Version                                                         Repository                                             Size
=================================================================================================================================================================================================================================================
Installing:
 xorg-x11-xdm                                                  i386                                                  1:1.0.5-7.el5                                                   base                                                  121 k

Transaction Summary
=================================================================================================================================================================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 121 k
Is this ok [y/N]: y
Downloading Packages:
http://mirror.centos.org/centos/5/os/i386/CentOS/xorg-x11-xdm-1.0.5-7.el5.i386.rpm: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.


Error Downloading Packages:
  1:xorg-x11-xdm-1.0.5-7.el5.i386: failure: CentOS/xorg-x11-xdm-1.0.5-7.el5.i386.rpm from base: [Errno 256] No more mirrors to try.

我的系统是centos5.11,yum源目录内容如下:

[root@www etc]# cd yum.repos.d/
[root@www yum.repos.d]# ls
bak  CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo
[root@www yum.repos.d]# cd bak
[root@www bak]# ls
adobe-linux-i386.repo  CentOS-Base.repo.bak


我首先把adobe-linux-i386.repo移到bak目录,重新运行yum命令,还是报错。接着把CentOS-Base.repo文件备份到bak目录,然后在源目录重新配置此文件。
开始我配置的源站点是http://vault.centos.org/,实际效果不行,yum报超时错误,后来改成国内清华大学站点,最终成功。
配置内容如下:

[root@www yum.repos.d]# cat CentOS-Base.repo 
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base - 163.com
#baseurl=http://vault.centos.org/5.11/os/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/
gpgcheck=1
#gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/RPM-GPG-KEY-CentOS-5

#released updates 
[updates]
name=CentOS-$releasever - Updates - 163.com
#baseurl=http://vault.centos.org/5.11/updates/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/updates/i386/
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons - 163.com
#baseurl=http://vault.centos.org/5.11/addons/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/addons/i386/
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#baseurl=http://vault.centos.org/5.11/extras/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/extras/i386/
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
#baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/centosplus/i386/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
#baseurl=http://vault.centos.org/5.11/contrib/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/contrib/i386/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/5.11/os/i386/RPM-GPG-KEY-CentOS-5


主要改两个条目,一是baseurl,二是gpgkey,每个[]里的项目名字和源站点的目录树的目录对应,[base]除外,它对应于目录树的os目录,具体项目名字的意义,在本配置文件里有说明,比如[addons]的意义是“#packages used/produced in the build but not released”
下图是清华大学镜像站centos5.11目录树的其中一级:
 
目录/etc/yum.repos.d下的其他文件不用管。
下面是配置好后执行yum命令的输出:
 

[root@www ~]# yum install xdm
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
addons                                                                                                                                                                                                                    | 1.9 kB     00:00     
base                                                                                                                                                                                                                      | 1.1 kB     00:00     
extras                                                                                                                                                                                                                    | 2.1 kB     00:00     
extras/primary_db                                                                                                                                                                                                         | 164 kB     00:00     
updates                                                                                                                                                                                                                   | 1.9 kB     00:00     
updates/primary_db                                                                                                                                                                                                        | 904 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package xorg-x11-xdm.i386 1:1.0.5-7.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================================================
 Package                                                       Arch                                                  Version                                                         Repository                                             Size
=================================================================================================================================================================================================================================================
Installing:
 xorg-x11-xdm                                                  i386                                                  1:1.0.5-7.el5                                                   base                                                  121 k

Transaction Summary
=================================================================================================================================================================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 121 k
Is this ok [y/N]: y
Downloading Packages:
xorg-x11-xdm-1.0.5-7.el5.i386.rpm                                                                                                                                                                                         | 121 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : xorg-x11-xdm                                                                                                                                                                                                              1/1 

Installed:
  xorg-x11-xdm.i386 1:1.0.5-7.el5                                                                                                                                                                                                                

Complete!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章