11

I am trying to install for example mosquitto package with apt then I do

sudo apt-get install mosquitto

and I get an error

 dpkg: error: fgets gave an empty string from '/var/lib/dpkg/triggers/Unincorp'
 E: Sub-process /usr/bin/dpkg returned an error code (2)

I really don't know what can I do to fix it.
Using Ubuntu Release: 20.10

dahan raz
  • 381

1 Answers1

17

Finally found the answer to this problem, all you need to do is

sudo rm /var/lib/dpkg/triggers/Unincorp
sudo touch /var/lib/dpkg/triggers/Unincorp

and then just run

sudo dpkg --configure -a

IDK why this solves the problem but I guess it's because the file was corrupted...

dahan raz
  • 381