/var/lib/dpkg/info/*.md5sums
/var/lib/dpkg/info/*.md5sums
/var/lib/dpkg/info/*.md5sums
sudo apt-get update
sudo apt-get install debsums
sudo apt-get update
sudo apt-get install debsums
sudo apt-get update
sudo apt-get install debsums
debsums --version
debsums --version
debsums --version
debsums bash
debsums bash
debsums bash
debsums --silent bash
debsums --silent bash
debsums --silent bash
sudo debsums -c
sudo debsums -c
sudo debsums -c
sudo debsums -ca
sudo debsums -ca
sudo debsums -ca
sudo debsums -ce
sudo debsums -ce
sudo debsums -ce
sudo apt-get --reinstall -d install $(debsums -l)
sudo apt-get --reinstall -d install $(debsums -l)
sudo apt-get --reinstall -d install $(debsums -l)
sudo debsums -cagp /var/cache/apt/archives
sudo debsums -cagp /var/cache/apt/archives
sudo debsums -cagp /var/cache/apt/archives
sudo debsums -c
sudo debsums -c
sudo debsums -c
sudo debsums -ca
sudo debsums -ca
sudo debsums -ca
sudo apt-get --reinstall -d install $(debsums -l)
sudo apt-get --reinstall -d install $(debsums -l)
sudo apt-get --reinstall -d install $(debsums -l)
sudo debsums -cagp /var/cache/apt/archives
sudo debsums -cagp /var/cache/apt/archives
sudo debsums -cagp /var/cache/apt/archives
/usr/bin/example-tool
/usr/bin/example-tool
/usr/bin/example-tool
dpkg -S /usr/bin/example-tool
dpkg -S /usr/bin/example-tool
dpkg -S /usr/bin/example-tool
example-package: /usr/bin/example-tool
example-package: /usr/bin/example-tool
example-package: /usr/bin/example-tool
sudo debsums -c
sudo debsums -c
sudo debsums -c
dpkg -S $(sudo debsums -c) | cut -d: -f1 | sort -u
dpkg -S $(sudo debsums -c) | cut -d: -f1 | sort -u
dpkg -S $(sudo debsums -c) | cut -d: -f1 | sort -u
sudo apt-get install --reinstall $(dpkg -S $(sudo debsums -c) | cut -d: -f1 | sort -u)
sudo apt-get install --reinstall $(dpkg -S $(sudo debsums -c) | cut -d: -f1 | sort -u)
sudo apt-get install --reinstall $(dpkg -S $(sudo debsums -c) | cut -d: -f1 | sort -u)
sudo dpkg --verify
sudo dpkg --verify
sudo dpkg --verify
#!/usr/bin/env bash
set -euo pipefail echo "== debsums changed package files =="
sudo debsums -c || true echo
echo "== debsums changed package + config files =="
sudo debsums -ca || true echo
echo "== packages missing checksum lists =="
debsums -l || true
#!/usr/bin/env bash
set -euo pipefail echo "== debsums changed package files =="
sudo debsums -c || true echo
echo "== debsums changed package + config files =="
sudo debsums -ca || true echo
echo "== packages missing checksum lists =="
debsums -l || true
#!/usr/bin/env bash
set -euo pipefail echo "== debsums changed package files =="
sudo debsums -c || true echo
echo "== debsums changed package + config files =="
sudo debsums -ca || true echo
echo "== packages missing checksum lists =="
debsums -l || true
chmod +x debsums-audit.sh
./debsums-audit.sh
chmod +x debsums-audit.sh
./debsums-audit.sh
chmod +x debsums-audit.sh
./debsums-audit.sh - install and use debsums
- check one package or the whole system
- include or exclude config files intentionally
- deal with packages that do not ship MD5 checksum lists
- repair changed package-managed files safely
- understand where debsums helps and where it does not - debsecan asks: which installed packages are known vulnerable?
- debsums asks: did the files installed by a package change? - locally modified package files
- missing package files
- some kinds of corruption or drift - -c means --changed
- it reports changed files
- it implies -s, so you only get problem output - -c shows changed files
- -a includes config files
- -g generates checksums for packages missing them
- -p /var/cache/apt/archives tells debsums where to find cached .deb files - it is practical for restoring package-managed files
- it does not mean every changed file should be overwritten blindly
- if the change was intentional, a reinstall may undo useful local work - a purpose-built package-file checksum tool
- --changed output that is easy to act on
- config-file-only or config-file-inclusive checks
- checksum generation for packages missing local sums, using cached .deb archives - a built-in dpkg integrity check
- a quick verification pass without installing another tool - a Debian host is acting strangely after manual changes
- you want to verify package-managed files before blaming the application
- you need a quick integrity pass after disk trouble or an unclean shutdown
- you are documenting a repeatable baseline-check workflow for Debian systems - Debian man page, debsums(1): https://manpages.debian.org/testing/debsums/debsums.1.en.html
- Debian man page, dpkg(1): https://manpages.debian.org/testing/dpkg/dpkg.1.en.html
- Dev.to live post reference used for anti-duplication check: https://dev.to/api/articles?username=lyraalishaikh&per_page=10&page=1