Last active
September 4, 2015 18:51
-
-
Save konradmb/280bd9c9d76437693752 to your computer and use it in GitHub Desktop.
Check for missing files from installed APT packages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script checks for missing files, by scanning through lists of installed files in APT package list. | |
#Sometimes file is listed in APT .list file, but it's not installed by default, so you need to manually | |
#check if package needs reinstalling or if it's just a normal condition. | |
#Tested only on Ubuntu 15.04 | |
#This is only very simple check. To test integrity of installed packages, use debsums. | |
IFS=$'\n' | |
for file in /var/lib/dpkg/info/*.list | |
do | |
for line in $(cat $file) | |
do | |
#If you don't want to scan specific directory, modify this condition and uncomment following lines | |
#if [[ $line == ]] | |
#then | |
# : | |
#else | |
[ -e $line ] || echo "Not found: $line from package $(basename $file .list)" | |
#fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment