1

I have uninstalled my VirtualBox using sudo apt-get remove --purge virtualbox-5.2 and the operation was successfull. But when run the command apt-cache pkgnames virtualbox it shows following result.

packages

So i run sudo apt-get remove virtualbox but it shows Package 'virtualbox' is not installed, so not removed. How can iremove those packages?

How to find the names for those packages to uninstall?

0

1 Answer 1

0

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

If you want look for installed packages, one way is to use 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.

So:

apt list --installed 'virtualbox*'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.