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

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

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

答案1

这是哪里手册很有用:

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.
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.

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

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

相关内容