跳到主要内容

yum

1、使用 yum 命令查看本机安装的软件

# 查看所有
sudo yum list installed
# 查找指定软件
sudo yum list installed | grep docker

2、yum 报错 multiple exception types must be parenthesized

报错信息:

  File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

问题原因:yum 需要使用 python2 编译,如果服务器使用的 python3 作为默认编译器就会提示这个错误。

解决方法:

# 查找 python 的安装路径
whereis python
# 编译 yum
vim /usr/bin/yum
# 修改第一行为 #!/usr/bin/python2.7

yum 撤销安装历史

yum history
yum historu undo transaction_id