Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # get list of all installed packages
- dpkg -l | grep ^ii | sed 's/ii \([^ ]*\).*$/\1/' > /tmp/list
- # get list of auto installed packages
- apt-mark showauto > /tmp/autopkg
- for pkg in `cat list`
- do
- RES=`dpkg -L $pkg | grep -c /usr/include`
- if [ $RES -gt 0 ]; then
- # reinstall package
- echo "Reinstalling [$pkg] with $RES matches found."
- apt-get install --reinstall $pkg
- if [ `grep -c $pkg /tmp/autopkg` -eq 1 ]; then
- echo "Remarking [$pkg] as auto installed."
- apt-mark auto $pkg
- fi
- fi
- done
- rm /tmp/list
- rm /tmp/autopkg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement