`apt search` 和 `apt list` 之间的区别?

alc*_*emy 4 package-management apt

我认为apt list是针对已安装的软件包,但看起来它需要--installed该标志。那么它和apt search. 前者是否只查找可用包的本地缓存?

mat*_*igo 5

这就是手册的用处:

apt search {criteria}

    search can be used to search for the given regex(7) term(s) in the list of available
    packages and display matches. This can e.g. be useful if you are looking for packages
    having a specific feature. If you are looking for a package including a specific file
    try apt-file.
Run Code Online (Sandbox Code Playgroud)
apt list {criteria}

   list is somewhat similar to dpkg-query --list in that it can display a list of
   packages satisfying certain criteria. It supports glob(7) patterns for matching
   package names as well as options to list installed (--installed), upgradeable
   (--upgradeable) or all available (--all-versions) versions.
Run Code Online (Sandbox Code Playgroud)

用简单的英语来说,apt search {criteria}您可以找到符合您在名称、描述或其他元数据中设置的条件的包。

apt list {criteria}但是,您可以选择根据包的名称以及它们是否已安装、当前可升级或只是存在(在包列表缓存的本地副本中)来列出包。

  • 我认为“搜索”是“查找我不知道名称的包”,而“列表”是“查找我知道名称的包的*状态*” (2认同)