事实证明,删除虚拟包apt-get
只会删除包本身,留下由它安装的真实包
那么如何删除虚拟包以及它安装的所有真实包呢?
答案1
用于apt-cache depends
查找虚拟包“包含”的包列表,然后删除所有这些包以删除虚拟包。例如:
$ 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
现在您要做的就是sudo apt-get remove
列出所有包Depends:
,完成后,虚拟包mono-complete
将被自动删除。
首先运行sudo apt-cache depends
命令查看所有依赖包,然后,如果包列表显示可以删除,则可以使用它来全部删除它们:
$ sudo apt-get remove `apt-cache depends mono-complete | grep Depends | cut -d : -f 2`
一旦工作完成,您可以使用以下方式检查虚拟包状态:
$ dpkg -l mono-complete
它应该被标记为(未)安装。
答案2
“虚拟”包是指仅包含对其他包的引用, 或者仅包含自定义配置文件的软件包。
因此您无法删除虚拟包,您需要删除真实的引用或创建“虚拟”包的包。
答案3
您无法单独删除虚拟包。当您完全删除真实包时,虚拟包也会自动删除。删除配置文件时,您必须使用删除包apt-get purge
命令。
答案4
这些答案并没有解决问题。问题是“我可以删除它们吗?”答案是可以的,但没有给出删除它们的命令。他们只提到了计算机终端问题,安装了它们后无法删除它们?那么这是一个错误或这个问题没有得到解答。
我也有同样的问题-
我按照提示进行操作apt-get purge
,purge -f
得到以下结果:
以下软件包具有未满足的依赖关系:
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
有没有办法删除虚拟包以便安装另一个 chrome 包?
这不是原始问题;但是,由于他曾尝试但未能解决如何完全删除虚拟包的问题,所以这大致相同。
我已经安装了 Aptitude,Aptitude 建议删除 Chromium。Chromium 是一个虚拟包;Aptitude 删除了 Chromium 及其虚拟剩余部分,以便我可以重新安装。
因此我建议安装 Aptitude,并通过sudo aptitude
在终端中输入并选择Package Resolver
> Remove
>“包名称”来使用包解析器。