How is the command for apt when installing to check, make sure every dependency really exists recursively?

Some past disaster remove many /usr/bin binaries just to be skipped and overlooked by apt which innocently confirm installation is perfect.

Please how to have it?

1 Answer 1

dpkg -V

will look at all installed packages and report any missing or modified files. You can use this to build a list of missing binaries; dpkg -S will then allow you to determine which packages provide these binaries, and then

apt reinstall ...

will allow you to reinstall all the packages which aren’t complete.

This should do the trick:

dpkg -S $(dpkg -V | awk '/\/bin\// { print $2 }' | sort -u) |
awk -F: '{ print $1 }' |
sort -u |
xargs sudo apt reinstall

If you don’t want to check the changes before confirming them, add -y to the apt command (... apt reinstall -y).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy