Centos7

在 CentOS7 上使用 Yum 刪除軟體包時遇到問題

  • April 28, 2019

**問題:**從系統和 Yum 中刪除 python-boto。它似乎不再安裝,但仍然出現在 Yum 中。

試過: yum clean all; 百勝檢查;rpm -e –noscripts python-boto 和 rpm -e –noscripts python-boto.noarch 但尚未解決。使用 find 檢查包是否存在。有關每個的詳細結果,請參見下文。

**問題:**我還能嘗試什麼以及嘗試它有什麼風險

# yum list | grep boto
python-boto.noarch                      2.25.0-2.el7.centos             extras
python-boto3.noarch                     1.4.6-5.el7                     base
python2-XStatic-roboto-fontface.noarch  0.4.3.2-4.el7                   epel
python2-boto.noarch                     2.45.0-3.el7                    epel
python2-boto3.noarch                    1.4.6-1.el7                     epel
python2-botocore.noarch                 1.6.0-1.el7                     epel


# yum remove python-boto
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
             : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No Match for argument: python-boto
No Packages marked for removal


# yum clean all --verbose
Loading "fastestmirror" plugin
Loading "product-id" plugin
Loading "search-disabled-repos" plugin
Loading "subscription-manager" plugin
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Config time: 0.074
Yum version: 3.4.3
Cleaning repos: base epel extras mariadb nodesource openproject-ce remi
             : remi-php56 remi-php73 remi-safe updates
Operating on /var/cache/yum/x86_64/7 (see CLEAN OPTIONS in yum(8) for details)
Disk usage of /var/cache/yum/*/* after cleanup:
0      enabled repos
16 M   disabled repos:
 16 M   /var/cache/yum/x86_64/7/centosplus
0      untracked repos
628    other data:
 628    /var/cache/yum/x86_64/7/timedhosts
16 M   total


# yum list | grep boto
python-boto.noarch                      2.25.0-2.el7.centos             extras
python-boto3.noarch                     1.4.6-5.el7                     base
python2-XStatic-roboto-fontface.noarch  0.4.3.2-4.el7                   epel
python2-boto.noarch                     2.45.0-3.el7                    epel
python2-boto3.noarch                    1.4.6-1.el7                     epel
python2-botocore.noarch                 1.6.0-1.el7                     epel


# yum check
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
             : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
check all


# yum list | grep boto
python-boto.noarch                      2.25.0-2.el7.centos             extras
python-boto3.noarch                     1.4.6-5.el7                     base
python2-XStatic-roboto-fontface.noarch  0.4.3.2-4.el7                   epel
python2-boto.noarch                     2.45.0-3.el7                    epel
python2-boto3.noarch                    1.4.6-1.el7                     epel
python2-botocore.noarch                 1.6.0-1.el7                     epel


# yum remove python-boto
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
             : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No Match for argument: python-boto
No Packages marked for removal


# find / -name *boto* -print
/usr/lib/python2.7/site-packages/boto3
/usr/lib/python2.7/site-packages/botocore
/usr/lib/python2.7/site-packages/botocore-1.12.134.dist-info
/usr/lib/python2.7/site-packages/boto3-1.9.134.dist-info

# rpm -e python-boto
error: package python-boto is not installed
# rpm -e --noscrips python-boto
rpm: --noscrips: unknown option
# rpm -e --noscripts python-boto
error: package python-boto is not installed
# rpm -e --noscripts python-boto.noarch
error: package python-boto.noarch is not installed

非常感謝您的幫助。

該軟體包根本沒有安裝。

yum list列出所有可用的軟體包,無論是否安裝。

要僅顯示已安裝的軟體包,請使用yum list installed.

yum list installed | grep boto

在基於 rpm 的發行版中查找已安裝軟體包的另一種方法是rpm -qa|grep,因此首先確保已安裝軟體包,如果已安裝,您可以從rpm -e或使用yum remove刪除軟體包。我希望它會幫助你。

引用自:https://serverfault.com/questions/964663