Debian软件包:区分“所请求的安装”从“安装以满足依赖关系” [英] Debian packages: distinguish "requested install" from "installed to satisfy dependencies"

查看:242
本文介绍了Debian软件包:区分“所请求的安装”从“安装以满足依赖关系”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我如何确定哪个程序包安装是因为我请求了安装以及哪些软件包自动安装以便满足依赖性

在适应性中,此信息显示为A:

  i A fam ... 
i grub ...
i一个grub-common ...

这表明因此,我请求了grub并且安装了grub-common。但是,aptitude是一个交互式程序,我无法自动提取这些信息来处理脚本。



使用debian包管理工具'dpkg -l'或'dpkg --get-choices',我可以得到一个安装的包的列表附加信息。例如

 > dpkg -l 
...
ii grub 0.97-47lenny2 GRand Unified Bootloader(旧版)
ii grub-common 1.96 + 20080724-16 GRand Unified Bootloader,版本2(普通文件)
ii gs-common 8.62.dfsg.1-3.2lenny1虚拟包取决于ghostscript
...

此列表可以轻松地使用脚本进行处理,但它只显示程序包已安装---不是通过请求或依赖关系。

解决方案

确实可以用所谓的搜索模式调用aptitude搜索;请参阅 http://algebraicthunk.net/~dburrows/参考projects / aptitude / doc / en / ch02s03s05.html#tableSearchTermQuickGuide
search〜我生成已安装的软件包。使用grep放弃包裹,A给了包不自动安装,所以它几乎可以回答原来的问题。



但它包括属于原始分发的包,所以它不是完全整理出来在我的情况下,它仍然是1500包,一组我可以处理。



它可能通过搜索组合来做,我没有挖,这里是我的命令:

  aptitude search〜i | grep -v'^ i A' 

grep -v丢弃依赖软件包


How can I determine which packages where installed because I requested the installation and which packages where automatically installed in order to satisfy dependencies?

In aptitude, this information is shown as "A":

i A fam         ...
i   grub        ...
i A grub-common ...

This shows that I requested the package grub and that grub-common was installed as a result of this. However, aptitude is an interactive program, I cannot extract this information automatically to process it with a script.

With the debian package management tool 'dpkg -l' or 'dpkg --get-selections', I can get a list of installed package with additional information. E.g.

> dpkg -l
...
ii  grub                                 0.97-47lenny2              GRand Unified Bootloader (Legacy version)
ii  grub-common                          1.96+20080724-16           GRand Unified Bootloader, version 2 (common files)
ii  gs-common                            8.62.dfsg.1-3.2lenny1      Dummy package depending on ghostscript
...

This list can easily be processed with scripts, but it only shows that the packages are installed --- not whether by request or for dependencies.

解决方案

indeed one can call aptitude search with the so-called search patterns; see reference at http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s03s05.html#tableSearchTermQuickGuide search ~i yields installed packages. Using grep to discard packages with A gives packages not automatically installed, so it almost answers the original question.

But it includes packages that belong to the original distribution, so its not completely sorted out. In my case, its still 1500 packages, a set I can deal with.

Its probably possible to do it by search combination, I didnt dig, here is my command:

aptitude search ~i|grep -v '^i A'|

the grep -v discards dependent packages

这篇关于Debian软件包:区分“所请求的安装”从“安装以满足依赖关系”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆