Package-Management

yum info vim 沒有任何匹配的軟體包要列出

  • September 8, 2021

為什麼不yum info vim返回有關我的 Fedora 34 機器上安裝的 vim 的資訊?

[root@oatmeal ~]# yum info vim
Last metadata expiration check: 0:06:02 ago on Wed 08 Sep 2021 08:01:25 EDT.
Error: No matching Packages to list

vim在我的主機上安裝和配置:

[root@oatmeal ~]# which vim
/usr/bin/vim
[root@oatmeal ~]# vim --version | head -n 4                                                                                                                                                                                                   
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 06 2021 00:00:00)
Included patches: 1-3404
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>

有關於其他已安裝軟體包的資訊:

[root@oatmeal ~]# yum info openssl                                                                                                                                                                                                            
Last metadata expiration check: 0:05:49 ago on Wed 08 Sep 2021 08:01:25 EDT.
Installed Packages
Name         : openssl
Epoch        : 1
Version      : 1.1.1l
Release      : 1.fc34
Architecture : x86_64
Size         : 1.1 M
Source       : openssl-1.1.1l-1.fc34.src.rpm
Repository   : @System
From repo    : updates
Summary      : Utilities from the general purpose cryptography library with TLS implementation
URL          : http://www.openssl.org/
License      : OpenSSL and ASL 2.0
Description  : The OpenSSL toolkit provides support for secure communications between
            : machines. OpenSSL includes a certificate management tool and shared
            : libraries which provide various cryptographic algorithms and
            : protocols.

[root@oatmeal ~]# yum info firefox 
Last metadata expiration check: 0:05:56 ago on Wed 08 Sep 2021 08:01:25 EDT.
Installed Packages
Name         : firefox
Version      : 91.0.2
Release      : 1.fc34
Architecture : x86_64
Size         : 253 M
Source       : firefox-91.0.2-1.fc34.src.rpm
Repository   : @System
From repo    : updates
Summary      : Mozilla Firefox Web browser
URL          : https://www.mozilla.org/firefox/
License      : MPLv1.1 or GPLv2+ or LGPLv2+
Description  : Mozilla Firefox is an open-source web browser, designed for standards
            : compliance, performance and portability.

yum info vim沒有顯示任何內容的原因是提供的包vim(二進製文件)不是vim,而是vim-enhanced.

rpm -q --whatprovides /usr/bin/vim將告訴您哪個軟體包提供了相關的二進製文件,並且yum info vim-enhanced(或dnf info vim-enhanced)將向您顯示有關該軟體包的資訊。

如果它在更高版本的基於 rpm 的發行版上,那麼他們將繼續使用 dnf。如果您認為該軟體包已經安裝,您可以嘗試dnf list --installed vim*. 否則,如果你認為包沒有安裝,你可以用’available’代替installed```

引用自:https://unix.stackexchange.com/questions/668165