LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: 亚森罗平

F7中使用axel加速yum--Updating....

[复制链接]
发表于 2007-6-17 20:29:52 | 显示全部楼层
苍天啊我才执行了第一步就用不了yum了
连添加删除软件都进不去

直接给我这个错误
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrors.fedoraproject.org ... ed-f7&arch=i386 error was
[Errno 12] Timeout: <urlopen error timed out>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-17 22:44:06 | 显示全部楼层
Post by joker14
苍天啊我才执行了第一步就用不了yum了
连添加删除软件都进不去

直接给我这个错误
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrors.fedoraproject.org ... ed-f7&arch=i386 error was
[Errno 12] Timeout: <urlopen error timed out>



你是下载的我的附件吗?
先 yum clean all 试试,如果不行在把所有步骤重新进行一次试试
回复 支持 反对

使用道具 举报

发表于 2007-6-18 00:58:05 | 显示全部楼层
我只弄了第一步
没下你的附件
现在我搞定了
重新装了个yumex
但是插件下载不了
还是一样慢如牛
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-18 01:12:38 | 显示全部楼层
Post by joker14
我只弄了第一步
没下你的附件
现在我搞定了
重新装了个yumex
但是插件下载不了
还是一样慢如牛


关于附件不能下载的问题,请右键单击选择另存为,改名为对应的文件名即可
回复 支持 反对

使用道具 举报

发表于 2007-6-18 17:54:00 | 显示全部楼层
不是吧
你是叫我把attachment.htm这个文件改成axelget.tar.gz这个?
不是开玩笑的吧
回复 支持 反对

使用道具 举报

发表于 2007-6-18 17:59:05 | 显示全部楼层
感谢,fc7下面速度也不错
回复 支持 反对

使用道具 举报

发表于 2007-6-20 19:06:34 | 显示全部楼层

用命令行看可以看到用10线程在下载,用yumex没有显示axel加载成功,并用多线程下载,请问y

用命令行看可以看到用10线程在下载,用yumex没有显示axel加载成功,并用多线程下载,请问yumex是不是还要特殊配置一下?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-21 06:41:00 | 显示全部楼层
Post by hexhhc
用命令行看可以看到用10线程在下载,用yumex没有显示axel加载成功,并用多线程下载,请问yumex是不是还要特殊配置一下?


恩,我今天看了下输出内容,确实显示yumex没有显示加载axelget插件,但是在首选项中axelget插件却是启用的,不过做了任何改动单击确定好像都不能保存,很奇怪,我也很费解,这个问题只能请教一下wq1997兄弟了!
回复 支持 反对

使用道具 举报

发表于 2007-6-23 13:17:06 | 显示全部楼层
加了那段判断语句后出现错误,请赐教?


Error Type: <type 'exceptions.IndentationError'>
Error Value: unindent does not match any outer indentation level (axelget.py, line 55)
  File : /usr/share/yumex/yumex.py , line 778, in <module>
    mainApp = YumexApplication() E
  File : /usr/share/yumex/yumex.py , line 421, in __init__
    self.yumbase = YumexYumHandler(self.getRecentTime(),self.settings,self.progress,self.ui.main,self.yumexOptions._optparser)
  File : /usr/share/yumex/yumapi.py , line 50, in __init__
    optparser = parser )
  File : /usr/lib/python2.5/site-packages/yum/__init__.py , line 109, in doConfigSetup
    errorlevel=errorlevel)
  File : /usr/lib/python2.5/site-packages/yum/__init__.py , line 151, in _getConfig
    startupconf.pluginconfpath)
  File : /usr/lib/python2.5/site-packages/yum/__init__.py , line 277, in doPluginSetup
    plugin_types, confpath)
  File : /usr/lib/python2.5/site-packages/yum/plugins.py , line 139, in __init__
    self._importplugins(types)
  File : /usr/lib/python2.5/site-packages/yum/plugins.py , line 180, in _importplugins
    self._loadplugin(modulefile, types)
  File : /usr/lib/python2.5/site-packages/yum/plugins.py , line 197, in _loadplugin
    module = imp.load_module(modname, fp, pathname, description)
回复 支持 反对

使用道具 举报

发表于 2007-6-23 13:35:04 | 显示全部楼层
这是我的完整代码

from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE
from urlparse import urljoin
import os

requires_api_version = '2.3'
plugin_type = (TYPE_CORE, TYPE_INTERACTIVE)

enablesize=300000
trymirrornum=-1
maxconn=10

def init_hook(conduit):
        global enablesize,trymirrornum,maxconn
        enablesize = conduit.confInt('main','enablesize',default=30000)
        trymirrornum = conduit.confInt('main','trymirrornum',default=-1)
        maxconn = conduit.confInt('main','maxconn',default=10)

def predownload_hook(conduit):
        global enablesize
        preffermirror=""
        for po in (conduit.getDownloadPackages()):               
                if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
                        continue
                totsize = long(po.size)
                ret = False
                if totsize <= enablesize:
                        conduit.info(2, "ackage %s download size %d less than %d,Skip plugin!"  % (po.repo.id,totsize,enablesize))
                        continue
                else:
                        conduit.info(2, "Ok,we will try to use axel to download this big file:%d" % totsize)
                local = po.localPkg()
                if os.path.exists(local):
                        if not os.path.exists(local+".st"):
                                fstate=os.stat(local)
                                if totsize == fstate.st_size:
                                        conduit.info(2,"Target already exists,skip to next file!")
                                        continue
                localall = "%s %s" % (local,local+".st")
                rmcmd = "rm -f %s" % (localall)
                curmirroridx = 0
                conduit.info(2,"Before we start,clean all the key files")
                os.system(rmcmd)
                connnum = totsize / enablesize
                if connnum > maxconn:
                        connnum = maxconn
                mirrors=[]
                mirrors[:0]=po.repo.urls
                if preffermirror != "":
                        mirrors[:0] = [preffermirror]
                for url in mirrors:
                        curmirroridx += 1
                        if (curmirroridx > trymirrornum) and (trymirrornum != -1):
                                conduit.info(2, "ackage %s has tried %d mirrors,Skip plugin!" % (po.repo.id,trymirrornum))
                                break
                 if  'updates' in url:
            remoteurl = urljoin(url, "i386/%s" % po.remote_path)
            else:
                           remoteurl = urljoin(url, "os/%s" % po.remote_path)
                        syscmd = "axel -a -n %s %s -o %s" % (connnum,remoteurl,local)
                        conduit.info(2, "Execute axel cmd:\n%s"  % syscmd)
                        os.system(syscmd)
                        if os.path.exists(local+".st"):
                                conduit.info(2,"axel exit by exception,let's try another mirror")
                                continue
                        else:
                                ret = True
                                preffermirror=url
                                break
                if not ret:
                        conduit.info (2,"try to run rm cmd:%s"  % rmcmd)
                        os.system(rmcmd)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表