为了理解为什么智能被安装在Linux上,我注意到apt-cache rdepends --installed aptitude的输出如下。
aptitude
Reverse Depends:
libapt-pkg6.0
|apt
apt
aptitude-common
aptitude-common
aptitude-common
libapt-pkg6.0
apt
|apt
mintbackup
mintsystem|之前的字符意味着什么?由于apt已经上市,我认为|apt有一个特殊的含义。
发布于 2020-08-02 23:03:32
管道在apt缓存中指示了什么?几乎解释了这一切。重新措辞:
如果apt-cache rdepends y返回|x行,这意味着x依赖于y | z | ... (管道表示“逻辑或”)。一个比喻:儿子取决于父亲或母亲,所以如果你做apt-cache rdepends father,它会列出|son,因为如果儿子有他的母亲,他可以没有父亲。
但是为什么apt和|apt都出现在这个列表中呢?让我们调查:
$ apt-cache show apt | grep 'aptitude'
Suggests: apt-doc, aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), gnupg | gnupg2 | gnupg1, powermgmt-base
Breaks: apt-transport-https (<< 1.5~alpha4~), apt-utils (<< 1.3~exp2~), aptitude (<< 0.8.10)apt-cache也在列出“中断”。手册中记载了这一点:
--no-pre-depends, --no-depends, --no-recommends, --no-suggests, --no-conflicts, --no-breaks, --no-replaces, --no-enhances
Per default the depends and rdepends print all dependencies.
This can be tweaked with these flags which will omit the specified dependency type.所以
apt-cache rdepends --no-breaks aptitude导致apt从输出中消失,而|apt仍然存在。
PS:由于您的输出包含2次|apt和2次以上的apt,您的apt-cache show apt应该用| aptitude返回2个条目,用aptitude返回2个条目(例如,在“推荐”和“替代”建议和“中断”时)。
https://unix.stackexchange.com/questions/602549
复制相似问题