使用yum下载时出现….rpm: [Errno 12] Timeout on

linux系统管理 struggling 2318次浏览 0个评论

以前下载使用yum下载时从未出现此问题,自从给yum换了163的源后,有好多rpm包一直下载不到,也没太注意此问题,但最近下载时又出现了新的问题,不得不注意下,网上找了半天才找到答案了。

<code>
使用yum下载nfs-utils时出现http://mirrors.163.com/centos/6/os/i386/Packages/xxxx-xxxx-xxx.i686.rpm:  [Errno 12] Timeout on
[root@localhost src]# yum install nfs-utils
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package nfs-utils.i686 1:1.2.3-54.el6 will be installed
--> Processing Dependency: nfs-utils-lib >= 1.1.0-3 for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: keyutils >= 1.4-4 for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: rpcbind for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libtirpc.so.1 for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libtirpc for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libnfsidmap.so.0 for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libgssglue.so.1(libgssapi_CITI_2) for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libgssglue.so.1 for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libgssglue for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libevent-1.4.so.2 for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Processing Dependency: libevent for package: 1:nfs-utils-1.2.3-54.el6.i686
--> Running transaction check
---> Package keyutils.i686 0:1.4-5.el6 will be installed
---> Package libevent.i686 0:1.4.13-4.el6 will be installed
---> Package libgssglue.i686 0:0.1-11.el6 will be installed
---> Package libtirpc.i686 0:0.2.1-10.el6 will be installed
---> Package nfs-utils-lib.i686 0:1.1.5-9.el6 will be installed
---> Package rpcbind.i686 0:0.2.0-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package              Arch        Version                  Repository   Size
=============================================================================
Installing:
 nfs-utils            i686        1:1.2.3-54.el6           base        328 k
Installing for dependencies:
 keyutils             i686        1.4-5.el6                base         38 k
 libevent             i686        1.4.13-4.el6             base         67 k
 libgssglue           i686        0.1-11.el6               base         23 k
 libtirpc             i686        0.2.1-10.el6             base         78 k
 nfs-utils-lib        i686        1.1.5-9.el6              base         66 k
 rpcbind              i686        0.2.0-11.el6             base         51 k

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

Total size: 652 k
Total download size: 407 k
Installed size: 1.6 M
Is this ok [y/N]: y
Downloading Packages:
http://mirrors.163.com/centos/6/os/i386/Packages/libtirpc-0.2.1-10.el6.i686.rpm: [Errno 12] Timeout on http://mirrors.163.com/centos/6/os/i386/Packages/libtirpc-0.2.1-10.el6.i686.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
http://mirrors.163.com/centos/6/os/i386/Packages/nfs-utils-1.2.3-54.el6.i686.rpm: [Errno 12] Timeout on http://mirrors.163.com/centos/6/os/i386/Packages/nfs-utils-1.2.3-54.el6.i686.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.


Error Downloading Packages:
  1:nfs-utils-1.2.3-54.el6.i686: failure: Packages/nfs-utils-1.2.3-54.el6.i686.rpm from base: [Errno 256] No more mirrors to try.
  libtirpc-0.2.1-10.el6.i686: failure: Packages/libtirpc-0.2.1-10.el6.i686.rpm from base: [Errno 256] No more mirrors to try.

这就是遇到的问题,解决方法如下:
[root@localhost src]# cd  /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim CentOS6-Base-163.repo 
在命令模式下使用:
:%s/$releasever/6/g

:%s/$basearch/i386/g
然后保存退出。

[root@localhost yum.repos.d]# echo `host mirrors.163.com|cut -d' ' -f4` mirrors.163.com>>/etc/hosts
最后在加上此句话,将mirrors.163.com的ipv4地址写入到etc/hosts文件中。

[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecashe

造成上述原因是因为$releasever和$basearch这两个变量不存在,只能用数字6和i386替换。


</code>

DevOps-田飞雨 》》转载请注明源地址
喜欢 (0)or分享 (0)
发表我的评论
取消评论
*

表情 贴图 加粗 链接 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址