如何找到包名称来卸载包?

如何找到包名称来卸载包?

我已经卸载了 VirtualBox sudo apt-get remove --purge virtualbox-5.2,操作成功。但运行命令时apt-cache pkgnames virtualbox显示以下结果。

所以我运行sudo apt-get remove virtualbox但它显示Package 'virtualbox' is not installed, so not removed。如何删除这些包?

如何找到需要卸载的软件包的名称?

答案1

man apt-cache

pkgnames [prefix]
   This command prints the name of each package APT knows. The
   optional argument is a prefix match to filter the name list.
   [...]

   Note that a package which APT knows of is not necessarily available
   to download, installable or installed, e.g. virtual packages are
   also listed in the generated list.

如果你想查找已安装的软件包,一种方法是使用apt list

list (work-in-progress)
   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 list --installed 'virtualbox*'

相关内容