I was able to update packages using

$ sudo apt-get update

but when I tried to install telnet using

$ sudo apt-get install telnet,

I get the following errors

dpkg: unrecoverable fatal error , aborting:
too-long line or missing new line in /var/lib/dpkg/diversions'
E: Sub-process /usr/bin/dpkg returned an error code (2)

I'm unable to install any other software as well Neither could I find any online resources which solved the problem. I'm currently using debian os, raspberry pi model b+. Please help me out


I got the same problem and managed to fix it (? hopefully) by emptying the /var/lib/dpkg/diversions file:

sudo mv /var/lib/dpkg/diversions ./diversions.backup
sudo touch /var/lib/dpkg/diversions

on a pi 3 with Raspbian Jessie.

| improve this answer | |
  • @Fabian pi 3 with Raspbian Jessie – YAG Mar 17 '18 at 14:58

The problem is likely dpkg

sudo dpkg --configure -a   
sudo apt-get clean
sudo dpkg-divert --list 
sudo apt-get check
sudo apt-get install -f
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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