如何使 apt-cache 仅显示已安装软件包的列表?

如何使 apt-cache 仅显示已安装软件包的列表?

我运行了这个命令:

apt-cache rdepends my-package-here

结果包括我的设置中未安装的应用程序。我只想查看已安装的软件包。

答案1

根据apt-cache 人标志:

--depends pkg...
depends shows a listing of each dependency a package has and all the possible other packages that can fulfill that dependency.
--rdepends pkg...
rdepends shows a listing of each reverse dependency a package has.
--installed
Limit the output of depends and rdepends to packages which are currently installed. Configuration Item: APT::Cache::Installed.

您可以使用此命令:

apt-cache --installed rdepends my-package-here
my-package-here
  Depends: something
  Depends: something
  Depends: something
  Depends: something
  Depends: something
  Depends: something
  Depends: something

答案2

如果您只想显示系统上安装的软件包

请改用以下命令:

apt-rdepends --state-follow=Installed --state-show=Installed package_name

人适合依赖

相关内容