It turns out that removing a virtual package with apt-get
only remove the package itself, leaving behind the real packages that were installed by it
So how do you remove a virtual package, along with all the real packages that it installs?
Use apt-cache depends
to find a list of packages that the virtual package "contains" and then remove all of those in order to remove the virtual package. For example:
$ sudo apt-cache depends mono-complete
mono-complete
Depends: mono-runtime
Depends: mono-runtime-sgen
Depends: libmono-2.0-1
Depends: libmono-profiler
Depends: mono-utils
Depends: mono-jay
Depends: mono-devel
Depends: mono-mcs
Depends: mono-csharp-shell
Depends: mono-4.0-gac
Depends: mono-4.0-service
Depends: monodoc-base
Depends: monodoc-manual
Depends: libmono-cil-dev
Depends: ca-certificates-mono
Now all you have to do is sudo apt-get remove
all of the packages listed after Depends:
and once done, the virtual package mono-complete
will be removed automagically.
Run sudo apt-cache depends
command first to take a look at all the dependent packages, and then, if the list of packages looks to you that it is ok to be removed, you can use this to remove them all:
$ sudo apt-get remove `apt-cache depends mono-complete | grep Depends | cut -d : -f 2`
Once the job is done, you can check virtual package status with:
$ dpkg -l mono-complete
It should be marked as (n)ot installed.
sudo apt-cache depends wine
, all it prints is <wine>
. (I use KUbuntu 18.04.)
Jul 1, 2019 at 18:31
'Virtual' packages are packages that only contain references to other packages, or packages that only contain customized configuration files.
Therefore you cannot remove virtual packages, you need to remove the real packages from which the 'virtual' ones was referenced or created from.
aptitude
. If you are looking for other options see the reference there.
You cannot remove virtual packages individually . When you remove the real packages completely, virtual packages are automatically removed. Remove configuration file with removing packages you have to use apt-get purge
command.
You mistaken meta-package for virtual-package. You have uninstalled a meta-package. Virtual package can't be removed directly, only by removing the package that provide it.
Look for them using:
aptitude search '~i~P<vitual-package>'
and change <vitual-package>
with the one you are looking for.
Verify using dry-run (simulation) of remove
aptitude -s remove '~i~P<vitual-package>'
#or
aptitude -s purge '~i~P<vitual-package>'
It it does not break any thing, carry on and uninstall them.
sudo aptitude remove '~i~P<vitual-package>'
#or
sudo aptitude purge '~i~P<vitual-package>'
Otherwise, it it tried to remove important packages too. Look and install replacements before that.
References:
These answers didn't solve the question. The question is "can I remove them" The answers were yes, but didn't give the commands to remove them. They only refer to computers terminals problems having installed them it cannot remove them? Then this is a bug or this question is unanswered.
I have the same problem-
I followed the prompts to apt-get purge
then purge -f
and got the following:
The following packages have unmet dependencies:
google-chrome-stable:i386 : Depends: libasound2:i386 (>= 1.0.23) but it is not installed
Depends: libatk1.0-0:i386 (>= 1.12.4) but it is not installed
Depends: libcairo2:i386 (>= 1.6.0) but it is not installed
Depends: libcups2:i386 (>= 1.4.0) but it is not installed
Depends: libfontconfig1:i386 (>= 2.8.0) but it is not installed
Depends: libgconf-2-4:i386 (>= 2.31.1) but it is not installed
Depends: libgcrypt11:i386 (>= 1.4.5) but it is not installed
Depends: libgdk-pixbuf2.0-0:i386 (>= 2.22.0) but it is not installed
Depends: libglib2.0-0:i386 (>= 2.18.0) but it is not installed
Depends: libgtk2.0-0:i386 (>= 2.24.0) but it is not installed
Depends: libnspr4:i386 (>= 1.8.0.10) but it is not installed
Depends: libnss3:i386 (>= 3.14.3) but it is not installed
Depends: libpango1.0-0:i386 (>= 1.22.0) but it is not installed
Depends: libudev0:i386 (>= 147) but it is not installed or
libudev1:i386 (>= 198) but it is not installable
Depends: libxcomposite1:i386 (>= 1:0.3-1) but it is not installed
Depends: libxi6:i386 (>= 2:1.2.99.4) but it is not installed
Depends: libxss1:i386 but it is not installed
Depends: libxtst6:i386 but it is not installed
Depends: libcurl3:i386 but it is not installed
Depends: xdg-utils:i386 (>= 1.0.2) but it is not installable
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
Is there an answer to removing the virtual packages so that another chrome package can be installed?
This isn't the original question; but, since he had tried and failed to resolve his problem of how to completely remove virtual packages, this is about the same.
I had already installed Aptitude and Aptitude's suggestion was removal of Chromium. Chromium is a Virtual package; and Aptitude removed Chromium and it's virtual remainder so I could reinstall.
So I would suggest installing Aptitude, and using Package Resolver by typing sudo aptitude
into terminal, choosing Package Resolver
>Remove
>"package name".
mono-complete
with the package I needed to remove. Whoops..
Apr 30, 2016 at 13:04
If you installed the virtual environment (ie. wine) from the Ubuntu app store, then you may want to remove such installations from the Ubuntu app store as well. It makes the process a bit easier.
Sometimes apt-cache depends <package>
outputs:
<package>
That means it has no dependencies. If you cant remove it using apt remove <package>
it means it has configuration files remaining on the disk. You can remove the package using apt purge <package>
which will remove the configuration file.
In my case, the package had no dependency but because it had configuration, it wasn't getting remove. Purging did the trick