2 ms·
Here's how to find and download the source for any command you have installed on any Debian or Debian-derived distribution: ~$ type column column is /u
by kragen 13y ago
Here's how to find and download the source for any command you have installed on any Debian or Debian-derived distribution:
~$ type column
column is /usr/bin/column
~$ dpkg -S /usr/bin/column
bsdmainutils: /usr/bin/column
~$ apt-get source bsdmainutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
NOTICE: 'bsdmainutils' packaging is maintained in the 'Git' version control system at:
git://git.debian.org/git/bsdmainutils/bsdmainutils.git
Need to get 277 kB of source archives.
Get:1 http://ftp.br.debian.org/debian/ wheezy/main bsdmainutils 9.0.3 (dsc) [1,060 B]
Get:2 http://ftp.br.debian.org/debian/ wheezy/main bsdmainutils 9.0.3 (tar) [276 kB]
Fetched 277 kB in 15s (17.7 kB/s)
gpgv: keyblock resource `/home/user/.gnupg/trustedkeys.gpg': file open error
gpgv: Signature made Mon 11 Jun 2012 07:32:33 AM ART using DSA key ID 29F19BD1
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./bsdmainutils_9.0.3.dsc
dpkg-source: info: extracting bsdmainutils in bsdmainutils-9.0.3
dpkg-source: info: unpacking bsdmainutils_9.0.3.tar.gz
~$ cd bsdmainutils-9.0.3/
~/bsdmainutils-9.0.3$ ls
config.mk debian freebsd.h Makefile patches README usr.bin
~/bsdmainutils-9.0.3$ find -name 'column*'
./usr.bin/column
./usr.bin/column/column.c
./usr.bin/column/column.1
./debian/patches/column_nomerge.diff
./debian/patches/column.diff
./debian/patches/column_empty_lines.diff
./debian/patches/column_empty.diff
./debian/patches/column_error.diff
Note that the Debian package separately includes the Debian-specific patches which, presumably, fix the bug you're suffering from. (`apt-get source` applied the diffs automatically, but they are useful when you want to, say, patch your BSD to fix the same bug.)
If you don't have the command installed, you can't use `type` and `dpkg -S` to find out what package it's in. Instead, use `apt-file`, which is not installed by default:
~/bsdmainutils-9.0.3$ apt-file search /column | wc -l
459
Oof.
~/bsdmainutils-9.0.3$ apt-file search /column | grep /column$
bsdmainutils: /usr/bin/column
yasnippet: /usr/share/emacs/site-lisp/yasnippet/snippets/text-mode/sql-mode/column