What does it mean when package manager can not determine from which package the corresponding command was installed.
When I do -
$ sudo dpkg -S /usr/bin/passwd
passwd: /usr/bin/passwd
from the output, I can infer that passwd
was installed from passwd
package
But for few command like - ftp
, bash
, cat
, ls
etc, the source info gives no lead about package. The below output is for bash
but the output for other commands like ftp
, cat
, ls
etc is exactly similar.
$ sudo dpkg -S /usr/bin/bash
dpkg-query: no path found matching pattern /usr/bin/bash
So, am puzzled what the above output means. Are these commands built in to shell or kernel (I don't think this is the case as commands/utils like ls
, cat
are part of coreutils package and man ls or cat confirms it.)
So, what does it mean when package manager can not determine from which package a command was installed.
Observation Notes:
$ sudo apt list coreutils
Listing... Done
coreutils/focal,now 8.30-3ubuntu2 amd64 [installed,automatic]
and
apt show coreutils | grep -Ew "ls|cat"
extract
Specifically, this package includes:
arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false flock fmt fold groups head hostid id install join link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc numfmt
EDIT - Following Stephens response. (Posted as a separate Q too - How to effectively trace hardlink in linux?
Softlinks are easier to handle but Hardlinks are not easily traceable to orginal file -
$ ll -i /usr/bin/bash /bin/bash
1310813 -rwxr-xr-x 1 root root 1183448 Jun 18 21:14 /bin/bash*
1310813 -rwxr-xr-x 1 root root 1183448 Jun 18 21:14 /usr/bin/bash*
above is as expected - cool
$ find / -samefile /bin/bash 2>/dev/null
/usr/bin/bash
again as expected - so no probs
find / -samefile /usr/bin/bash 2>/dev/null
/usr/bin/bash
this is NOT cool. now how do i trace the org file now
Strange - below did not help either.
$ find / -inum 1310813 2>/dev/null
/usr/bin/bash
/usr/bin/bash
? Ubuntu has bash at/bin/bash
. Same for/bin/cat
and/bin/ls
. – muru Sep 02 '20 at 11:44