devsetup1-3 Exercise 1: Command, Path, Version, Package ========================================================= COMMANDS TO RUN --------------- For each tool NAME in: git rg lspci gcc python3 command -v NAME # does the command exist, and where? NAME --version | head -n 1 # which version? dpkg -S "$(command -v NAME)" # which Debian package owns that file? Or all at once: for c in git rg lspci gcc python3; do p=$(command -v "$c") || { echo "$c: MISSING"; continue; } echo "== $c"; echo "path: $p" echo "version: $("$c" --version 2>&1 | head -n 1)" echo "package: $(dpkg -S "$p" 2>&1 | head -n 1)" done EXPECTED SHAPE OF THE RESULT ---------------------------- Your versions will differ. The paths and owning packages should look like this on a standard Debian 13 desktop: Command Path Owning package git /usr/bin/git git rg /usr/bin/rg ripgrep lspci /usr/bin/lspci pciutils gcc /usr/bin/gcc gcc (a link to a versioned gcc) python3 /usr/bin/python3 python3-minimal Treat your own dpkg -S output as authoritative; Debian sometimes moves files between packages. WHERE THE NAMES DIFFER ---------------------- - rg -> ripgrep: the command is the tool's short name, the package uses the project's full name. - lspci -> pciutils: one package provides a whole family of PCI utilities. - gcc: installing build-essential caused it to be installed, but there is no command called build-essential. The package is a "meta-package" that depends on the compiler and make. - python3 -> python3-minimal: the command belongs to a smaller package that the fuller python3 package depends on. Where the two names are the same (git), it is easy to forget they are different things. Always ask the package system about package names and the shell about command names. WHY THIS WORKS AS AN ANSWER --------------------------- The three commands answer three different questions (exists? which version? owned by what?), and the differences in the last column show why "is the package installed?" and "does the command exist?" are not the same test.