有没有办法在 Debian 中找到半配置的软件包?这是来自Debian strech - 更新损坏 - 似乎有 bug dpkg。
我尝试看看包裹是否被两种方式破坏 -
a. $ aptb
┌─[shirish@debian] - [~] - [5289]
└─[$] alias aptb
aptb='aptitude search '\''~b'\'
越多越好——
┌─[shirish@debian] - [~] - [5288]
└─[$] dpkg --audit
┌─[shirish@debian] - [~] - [5289]
└─[$]
是否还有其他工具可以完成所需/上述任务?
更新 - 我明白了 -
[$] dpkg -f '${status} ${package}\n' -W | awk '$2 == "half-configured" {print $4}'
dpkg-deb: error: failed to read archive '${status} ${package}\n': No such file or directory
[$] dpkg -f '${status} ${package}\n' -W | awk '$2 == "half-configured" {print $4}'
dpkg-deb: error: failed to read archive '${status} ${package}\n': No such file or directory
这些是预期的输出吗?
答案1
快速输入:
dpkg -l | grep -v '^ii'
这列出了系统至少不太了解但未完美安装的任何软件包。
如果您想要可解析的输出,请使用dpkg-query
具有自定义格式。根据您的意愿调整过滤器。
dpkg-query -f '${status} ${package}\n' -W | awk '$3 != "installed" {print $4}'
dpkg-query -f '${status} ${package}\n' -W | awk '$3 == "half-configured" {print $4}'
答案2
dpkg --audit
-C, --audit [package-name...]
Performs database sanity and consistency checks for package-name
or all packages if omitted (per package checks since dpkg 1.17.10).
For example, searches for packages that have been installed only
partially on your system or that have missing, wrong or obsolete
control data or files. dpkg will suggest what to do with them to
get them fixed.
来源:man dpkg