Howto: Search & Repair All corrupted Packages

Share your own howto's etc. Not for support questions!
Post Reply
User avatar
Posts: 1895
Joined: 2015-04-02 13:15
Been thanked: 1 time

Howto: Search & Repair All corrupted Packages

#1 Post by bester69 »

We can search for any modified file in our system by using "debsums":
debsums can verify the integrity of installed package files against MD5 checksums installed by the package, or generated from a .deb archive.

0- Install debsums
sudo apt-get install debsums

1- Script for looking MISSING or FAILED (modified packages):

Code: Select all

if [[ $1 == "" ]]; then
echo "Buscando todos paquetes!!"
sudo debsums -a 2>&1|grep -e "missing file" -e "FAILED"
echo "Buscando  paquetes con: $1"
sudo apt-cache search "$1"|awk '{print $1}'|xargs debsums -a 2>&1|grep -e "missing file" -e "FAILED"
2- we run "find" script, and it will show in stdout all missing/failed files.
It might take a time (some minits to md5-check all packages in our system)

3- Search for modified packages and reinstall to repair.:
3.0. Search for altered package:
sudo dpkg -S (reported by debsum)
--> It reports Name package

3.1 Repair/reinstall all altered packages retuned by "find script" (debsums):
sudo apt-get install --reinstall Namepackage1
sudo apt-get install --reinstall Namepackage2
sudo apt-get install --reinstall NamepackageN
bester69 wrote:You wont change my mind when I know Im right, Im not an ...

Posts: 135
Joined: 2015-08-02 21:30

Re: Howto: Search & Repair All corrupted Packages

#2 Post by marcetm »

Added to my bookmark. Thanks for sharing.

Post Reply