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!

 

  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
如果您在运行 yum 命令时遇到 "储存库暂时禁用" 的错误消息,可能是由于某些储存库在一段时间内不可用或者出现了错误导致的。为了解决这个问题,您可以尝试以下步骤: 1. 检查储存库配置文件 打开储存库配置文件,通常位于 /etc/yum.repos.d/ 目录下,检查是否存在任何错误或者不完整的行。您可以备份该文件,然后手动编辑并修复任何错误。 2. 清除缓存 清除 yum 的缓存可能会解决该问题。您可以运行以下命令来清除 yum 缓存: ``` yum clean all ``` 3. 重新加载储存库 重新加载储存库可能会帮助您解决该问题。您可以运行以下命令来重新加载所有储存库: ``` yum makecache ``` 4. 禁用储存库 如果您确定某个储存库出现了问题,您可以禁用该储存库,以避免影响其他操作。您可以打开储存库配置文件并将该储存库的 enabled 选项设置为 0,例如: ``` [example] name=Example Repository baseurl=http://example.com/repo enabled=0 gpgcheck=1 ``` 5. 暂时更改储存库 如果您需要临时更改储存库,以便从其他可用源安装软件包,可以使用 --disablerepo 选项禁用特定储存库,并使用 --enablerepo 选项启用其他储存库,例如: ``` yum --disablerepo=example --enablerepo=centos install package-name ``` 以上是一些可能有助于解决 "储存库暂时禁用" 错误消息的步骤。如果这些步骤无法解决问题,您可能需要等待储存库恢复正常运行或者联系储存库管理员获得支持。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值