问:使用yum命令进行升级,无法正常升级,yum命令进行升级,无法正常升级
答:您好,
请问您具体做什么升级,无法升级有什么报错信息,请详细说明并提供相关截图这边看下,非常感谢您长期对我司的支持!
问:使用yum update -y定期更新系统漏洞
发现报错,无法正常升级,是不是硬盘坏道造成文件损坏了?
/usr/bin/yum: line 3: import: command not found
/usr/bin/yum: line 4: try:: command not found
/usr/bin/yum: line 5: import: command not found
/usr/bin/yum: line 6: except: command not found
/usr/bin/yum: line 24: syntax error near unexpected token `('
/usr/bin/yum: line 24: `""" % (sys.exc_value, sys.version)'
答:您好,
参考https://www.freesion.com/article// 说明,此问题应该是升级的python版本影响,目前服务器使用的是python3.7,请尝试使用旧python更新yum后重新使用yum命令看看是否正常,非常感谢您长期对我司的支持!
问:就是刚才试过了用python2.7进行更新也是报错,才确认是文件损坏。
[@ebs-99057 bin]# python2.7 yum install deltarpm -y
Loaded plugins: aliases, fastestmirror, protectbase
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* centos-sclo-rh: mirrors.aliyun.com
* elrepo: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.bfsu.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
0 packages excluded due to repository protections
Resolving Dependencies
–> Running transaction check
—> Package deltarpm.x86_64 0:3.6-3.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
===================================================================================
Package Arch Version Repository Size
===================================================================================
Installing:
deltarpm x86_64 3.6-3.el7 base 82 k
Transaction Summary
===================================================================================
Install 1 Package
Total download size: 82 k
Installed size: 209 k
Downloading packages:
Error downloading packages:
deltarpm-3.6-3.el7.x86_64: [Errno 5] [Errno 8] Exec format error
答:您好,
测试更新yum没有问题,报错大多都可以通过百度寻求解决办法,报错原因是
/usr/bin/yum文件和
/usr/libexec/urlgrabber-ext-down文件首行为空导致,将空行取消后即可执行yum的更新命令,现在已经完成,重新执行yum update -y提示没有可用更新,,非常感谢您长期对我司的支持!