If you use linux and for some reason you interrupt either purposefully or accidentally an installation of libraries (as I did when the power went out) there is a solution.
Here is the example:
The way to resolve this is pretty simple all you do is run this command.
If for any reason you can not remove the installation of the libraries then you can run this command.
If no reinstall was necessary you can just run this command.
And finally always run this command after installation to make sure the system is working as expected.
Here is the example:
C++:
Errors were encountered while processing:
g++-5
g++
build-essential
E: Sub-process /usr/bin/dpkg returned an error code (1)
The way to resolve this is pretty simple all you do is run this command.
C++:
sudo dpkg --remove g++-5 g++ build-essential
If for any reason you can not remove the installation of the libraries then you can run this command.
C++:
sudo dpkg --reinstall g++-5 g++ build-essential
If no reinstall was necessary you can just run this command.
C++:
sudo apt install g++-5 g++ build-essential
And finally always run this command after installation to make sure the system is working as expected.
C++:
sudo apt-get update