Howto: Search & Repair All corrupted Packages

Share your own howto's etc. Not for support questions!

Howto: Search & Repair All corrupted Packages

Postby bester69 » 2016-12-22 11:26

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):
find.sh
Code: Select all
#!/bin/bash
#
clear
if [[ $1 == "" ]]; then
echo "Buscando todos paquetes!!"
sudo debsums -a 2>&1|grep -e "missing file" -e "FAILED"
else
echo "Buscando  paquetes con: $1"
sudo apt-cache search "$1"|awk '{print $1}'|xargs debsums -a 2>&1|grep -e "missing file" -e "FAILED"
fi


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 libxx.so.xx (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
User avatar
bester69
 
Posts: 881
Joined: 2015-04-02 13:15

Re: Howto: Search & Repair All corrupted Packages

Postby marcetm » 2016-12-22 22:21

Added to my bookmark. Thanks for sharing.
marcetm
 
Posts: 128
Joined: 2015-08-02 21:30


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable