i am new to the raspberry and just setup my first one with a fresh NOOBS installation. First thing i did was mounting my external hard drive. Next i did sudo apt-get update && sudo apt-get upgrade. And i get an error...

dpkg: error processing package dmsetup (--configure):
  too-long line or missing newline in `/var/lib/dkpg/triggers/update-initramfs``
Erors were encountered while processing:

Can anybody help?

1 Answer 1


Please check your raspberry pi configuration

uname -a

Follow the below steps

  1. copy the status file for future

    sudo cp /var/lib/dpkg/status /var/lib/dpkg/status-old

  2. empty the status file

    sudo echo "" >/var/lib/dpkg/status

  3. populate the status file

    sudo apt-get update

  4. Upgrade using the below command

    sudo apt-get upgrade

  5. Update the firmware

    sudo rpi-update

This usually happens for debian machines. Let me know if you face any issues.

  • Thanks for your help. I have Raspian installed which is debian based. However i reinstalled Raspian via Noobs in the meantime and afterwards i had another, yet similar, dpkg error. Something with some mime package. However i tried to use your solution but on sudo echo "" > /var/lib/dpkg/status i got permission denied (even with sudo?). I thought the file might be locked and tried reboot... well it didn't boot anymore. So this time a simple apt-get update / upgrade broke my whole system? Once again, i have a brand new raspberry pi 2 b+ with Raspian via Noobs i downloaded just some days ago.
    – patman
    Jun 26, 2016 at 18:39
  • I'm sorry to hear that the solution did not do much good for you. If you are going to have fresh installation of Raspbian then I would suggest using the latest one Noobs 1.9.2 - Noobs 1.9.2 - downloads.raspberrypi.org/NOOBS_latest. I recently upgraded my Raspberry Pi from 1.4 version to 1.9.2. It works really good and when I turned off the GUI to console through raspi-config I got some good performance as well. Also the pi store packages are also depreciated on the latest version.
    – Varad A G
    Jun 27, 2016 at 4:26
  • Well i guess it was not the solution but the error itself that caused the problem. I am on Noobs 1.9.2. Do you have any idea why i might not be able to write thet dpkg status file even as sudo? For me at the moment the problem is that i cannot do apt-get update/upgrade because everytime it is failing... and this with my brandnew raspberry pi and fresh raspian installation. Should i do something else before updating/upgrading?
    – patman
    Jun 27, 2016 at 13:08
  • @patman can you tell me the permissions of this file. Can you check thepcspy.com/read/fixing-dpkg-status-corruption. Also try performing a sudo rpi-update. Some times updating firmware also fixes the issue.
    – Varad A G
    Jun 29, 2016 at 10:34
  • The permission are -rw-r--r--, belonging to root. I tried over and over and no luck, so i completely emtied the sd card and reinstalled everything from ground. I tried to empty the dpkg status file before apt-get operations bit permission was denied. I could however delete it (strange?) and touch for a new one. But after apt-get update&&upgrade it remained empty. I tried to install samba package and again dpkg failed because libc6 and multiarch-support are not configured. :-(
    – patman
    Jul 1, 2016 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.