apt-cache/apt 搜索未安装的软件包

apt-cache/apt 搜索未安装的软件包

我可以使用 搜索软件包apt-cache search <package_name>,或者使用 搜索已安装的软件包apt list --installed | grep <package_name>

那些没有安装的软件包怎么办?如何使用apt-cache或搜索未安装软件包的列表apt

答案1

你可以这样看到它们……但颜色不太好看

apt list --installed=false | grep -v '\[installed'

答案2

我意识到这并不使用apt-cacheapt,但aptitude提供了一些强大的搜索方法:

aptitude search '!~i ^apt*'

或者等价地,

aptitude search '?not(?installed) ^apt*'

产生如下输出:

p   apt-forktracer                                                                         - utility for tracking non-official package versions
p   apt-listbugs                                                                           - tool which lists critical bugs before each APT installation
p   apt-listdifferences                                                                    - source differences notification tool
p   apt-mirror                                                                             - APT sources mirroring tool
p   apt-move                                                                               - maintain Debian packages in a package pool
p   apt-offline                                                                            - offline APT package manager
p   apt-offline-gui                                                                        - offline APT package manager - GUI
p   apt-rdepends                                                                           - recursively lists package dependencies
p   apt-show-source                                                                        - Shows source-package information
p   apt-show-versions                                                                      - lists available package versions with distribution
p   apt-src                                                                                - manage Debian source packages
p   apt-transport-https                                                                    - https download transport for APT
...

请注意,每行的首字母表示包的状态;以下是一些常见的状态:

p     no trace of the package exists on system
c     package has configuration files remaining on system
v     virtual package

相关内容