首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >包名之前的“\”字符是什么意思?

包名之前的“\”字符是什么意思?
EN

Unix & Linux用户
提问于 2020-08-02 21:10:06
回答 1查看 70关注 0票数 1

为了理解为什么智能被安装在Linux上,我注意到apt-cache rdepends --installed aptitude的输出如下。

代码语言:javascript
复制
aptitude
Reverse Depends:
  libapt-pkg6.0
 |apt
  apt
  aptitude-common
  aptitude-common
  aptitude-common
  libapt-pkg6.0
  apt
 |apt
  mintbackup
  mintsystem

|之前的字符意味着什么?由于apt已经上市,我认为|apt有一个特殊的含义。

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2020-08-02 23:03:32

管道在apt缓存中指示了什么?几乎解释了这一切。重新措辞:

如果apt-cache rdepends y返回|x行,这意味着x依赖于y | z | ... (管道表示“逻辑或”)。一个比喻:儿子取决于父亲或母亲,所以如果你做apt-cache rdepends father,它会列出|son,因为如果儿子有他的母亲,他可以没有父亲。

但是为什么apt|apt都出现在这个列表中呢?让我们调查:

代码语言:javascript
复制
$ 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也在列出“中断”。手册中记载了这一点:

代码语言:javascript
复制
--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.

所以

代码语言:javascript
复制
apt-cache rdepends --no-breaks aptitude

导致apt从输出中消失,而|apt仍然存在。

PS:由于您的输出包含2次|apt和2次以上的apt,您的apt-cache show apt应该用| aptitude返回2个条目,用aptitude返回2个条目(例如,在“推荐”和“替代”建议和“中断”时)。

票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/602549

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档