devsetup1-10 Exercise 1: Audit the Machine =========================================== STEPS ----- mkdir -p ~/machine-setup && cd ~/machine-setup apt-mark showmanual | sort > packages-manual.txt { lsb_release -ds; uname -r; python3 --version; php --version | head -1; composer --version; mariadb --version; git --version; code --version | head -1; nvidia-smi --query-gpu=driver_version --format=csv,noheader; } > versions.txt pipx list > pipx.txt code --list-extensions > vscode-extensions.txt ls ~/.nvm ~/.pyenv /usr/local/bin > non-apt.txt 2>&1 . ~/.nvm/nvm.sh && nvm current > node-version.txt ssh debserver 'lsb_release -ds; php --version | head -1; mysql --version || mariadb --version' > debserver-versions.txt Read each file. Expect: - versions.txt: Debian GNU/Linux 13 (trixie), a 6.12 kernel, Python 3.13, PHP 8.4, Composer 2.8, MariaDB 11.8, and the NVIDIA driver version. - non-apt.txt: "No such file or directory" for ~/.pyenv if you did not install pyenv; that is expected, and the 2>&1 keeps the message in the file. - debserver-versions.txt: older versions until the server is reinstalled. THREE PACKAGES YOU DID NOT CHOOSE --------------------------------- Pick any three from packages-manual.txt that you do not recognise and identify them: apt show PACKAGE | head -20 # description and section apt-cache rdepends --installed PACKAGE | head # what installed packages depend on it dpkg -L PACKAGE | head # what it put on the system Typical finds (yours will differ): desktop-environment packages, firmware packages, language or locale packages, and tools chosen in the installer's task selection. Note for each: did you want it, and would you want it on a rebuilt machine? WHY THE LIST IS A REFERENCE, NOT A RECIPE ----------------------------------------- The installer and the desktop environment mark many packages as manually installed. Replaying the whole list on another install can fail on renamed or removed packages and brings in choices you never made deliberately. Use it to build a short, intentional list (the one in bootstrap.sh) and to notice things you forgot were there. WHY THIS WORKS AS AN ANSWER --------------------------- Everything is captured from the running system with the checking commands from Chapter 3, into plain files that can go into Git. Investigating unfamiliar packages turns the audit from a copy job into an understanding of the machine.