2

When I run apt-cache depends tar under my Debian 8.3 installation, then it says that it will replace cpio:

# apt-cache depends tar
tar
  PreDepends: libacl1
  PreDepends: libc6
  PreDepends: libselinux1
  Suggests: bzip2
  Suggests: ncompress
  Suggests: xz-utils
  Suggests: tar-scripts
  Conflicts: cpio
  Breaks: dpkg-dev
  Replaces: cpio
# 

However, I have both cpio and tar packages installed:

$ COLUMNS=80 dpkg -l cpio tar
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  cpio           2.11+dfsg-5  amd64        GNU cpio -- a program to manage a
ii  tar            1.28-2.1     amd64        GNU version of the tar archiving 

(edited by cas: the version Martin has installed is 2.11+dfsg-4.1+deb8u1 rather than the 2.11+dfsg-5 I have from debian sid, but it makes no difference. Faheem's answer is still correct for the same reason)

How to understand the Replaces: field in output of apt-cache depends?

2 Answers 2

3

Your question is missing some information.

apt-cache show tar 

Package: tar
Version: 1.28-2.1
[snip]
Replaces: cpio (<< 2.4.2-39)
[snip]
Conflicts: cpio (<= 2.4.2-38)

Package: tar
Source: tar (1.27.1-2)
Version: 1.27.1-2+b1
[snip]
Replaces: cpio (<< 2.4.2-39)
[snip]
Conflicts: cpio (<= 2.4.2-38)

Notice that it says it replaces cpio for version << 2.4.2-39. Similarly for conflicts. Now, I also have cpio installed.

apt-cache policy cpio

cpio:
  Installed: 2.11+dfsg-4.1+deb8u1
  Candidate: 2.11+dfsg-4.1+deb8u1
  Version table:
     2.11+dfsg-5 0
         50 tor+http://httpredir.debian.org/debian/ unstable/main amd64 Packages
 *** 2.11+dfsg-4.1+deb8u1 0
        500 tor+http://security.debian.org/ jessie/updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.11+dfsg-4.1 0
        500 tor+http://httpredir.debian.org/debian/ jessie/main amd64 Packages

But the versions are much larger than 2.4.x. This is some ancient issue that could probably be dropped from the current tar. Feel free to file a bug.

2

"Replaces" are packages that will have one or more files replaced by the package you are searching on. For even more detail, see the Debian policy guide: https://www.debian.org/doc/debian-policy/ch-relationships.html#s-replaces

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.