我们的服务器上存在yum问题(Red Hat 5.7,Apache 2.2.3)。如果我尝试例如
yum update
发生以下错误:
Loaded plugins: downloadonly, replace, rhnplugin, security
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 309, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 157, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
self.conf
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
conf = property(fget=lambda self: self._getConfig(),
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 254, in _getConfig
self.plugins.run('init')
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/rhnplugin.py", line 121, in init_hook
login_info = up2dateAuth.getLoginInfo()
File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 219, in getLoginInfo
login()
File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 186, in login
li = server.up2date.login(systemId)
File "/usr/share/rhn/up2date_client/rhnserver.py", line 50, in __call__
return rpcServer.doCall(method, *args, **kwargs)
File "/usr/share/rhn/up2date_client/rpcServer.py", line 204, in doCall
ret = method(*args, **kwargs)
File "/usr/lib64/python2.4/xmlrpclib.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/share/rhn/up2date_client/rpcServer.py", line 68, in _request1
raise InvalidRedirectionError(
NameError: global name 'InvalidRedirectionError' is not defined
另一个问题是我们甚至不知道导致这个问题的原因。很可能有人更新了python并且不久前更改了默认版本(这个人不在了这里)。
我们在网上找到了一些修复yum的选项,但没有一个可以使用。有没有人知道如何解决这个问题?
答案 0 :(得分:0)
current_page = 1
def parse(self, response):
questions = Selector(response).xpath('.//div[@class="feature"]/h2')
for question in questions:
item = ReutersItem()
item['title'] = question.xpath('a/text()').extract()[0]
item['timeextraction'] = strftime("%Y-%m-%d %H:%M:%S", gmtime())
yield item
self.current_page += 1
yield Request("http://www.reuters.com/news/archive/businessNews?page={0}&pageSize=10&view=page".format(self.current_page))
并更改此行
vi /etc/yum/pluginconf.d/fastestmirror.conf
到
enable=1
如果这些都没有帮助。尝试执行
enable=0
然后运行
export LD_LIBRARY_PATH=/usr/lib64:/usr/local/lib
并测试你的百胜。 如果没关系 - 将此导出语句添加到.bash_profile
答案 1 :(得分:0)
问题不在于我们想象的python安装,而是服务器无法访问RHN。因此,迁移到新服务器后,问题现在得到解决。感谢大家的帮助!