Run sudo apt-get install libdpkg-perl=1.17.5ubuntu5 to downgrade libdpkg-perl.

You somehow installed a newer version of the package than what is in the repositories, which is causing problems with other packages.


Try Code:

sudo apt-get update

to update your package list.

Then Code:

sudo apt-get autoclean

to clean up any partial packages.

Then Code:

sudo apt-get clean

to clean up the apt cache.

Then Code:

sudo apt-get autoremove

will clean up any unneeded dependencies.

If while doing this you can identify the broken package this code will very forcefully remove it.

Code:

sudo dpkg --remove -force --force-remove-reinstreq <package name>

Change package name to the real name of course.

Then, go back to your build-essential install

Code:

sudo apt-get install dpkg-dev
sudo apt-get install build-essential

See, if this works for you.