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):
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 ...
User avatar
Posts: 1823
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.
Posts: 135
Joined: 2015-08-02 21:30

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 7 guests