Skip to main content
edited body
Source Link
  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s

  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s

  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s

added 1 character in body
Source Link
  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s

  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s

  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s

Source Link

  1. If you have a broken status file then you have to back up first:

    $ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.old

  2. Try to recover status file from /var/backups:

    $ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status && sudo apt update

  3. If 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 update

  4. When 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)

  5. 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 }') --reinstall

  6. Then check md5 sums of all packages, and if find such pkgs reinstall them:

    $ sudo debsums -s