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!

 

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