If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old corrupted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packegespackages missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s
If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old corrupted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packeges missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s
If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old corrupted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packages missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s
If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old coraptedcorrupted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packeges missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s
If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old corapted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packeges missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s
If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old corrupted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packeges missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s
If you have a broken status file then you have to back up first:
$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.oldTry to recover status file from /var/backups:
$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt updateIf still an error, so try next backup file:
$ sudo gunzip -k /var/backups/dpkg.status.1.gz && sudo mv /var/backups/dpkg.status.1 /var/lib/dpkg/status && sudo apt updateWhen apt updates without errors then you need to compare current status file with old corapted (use strings because file has binary data):
$ diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq)After that you will see difference and can reinstall packeges missing in current status file to add:
$ sudo apt install $(diff <(strings /var/lib/dpkg/status | grep 'Package:' | sort | uniq) <(strings /var/lib/dpkg/status.old | grep 'Package:' | sort | uniq) | grep '>' | awk '{ print $3 }') --reinstallThen check md5 sums of all packages, and if find such pkgs reinstall them:
$ sudo debsums -s