Errors were encountered while processing: /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb
Solution 1:
I had the same problem today on a Ubuntu 16.04.01 LTS Server. After a bit of reading and thinking what I had done on the system, I figured it had to do with the fact, that I changed the default python to Python3.5. For me, changing the python back to 2.7, doing the upgrade and switching back to 3.5 worked.
Changing the default python:
root@web03:~>update-alternatives --list python
/usr/bin/python2.7
/usr/bin/python3
root@web03:~>python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
root@web03:~>update-alternatives --install /usr/bin/python python /usr/bin/python2.7 3
update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode
root@web03:~>python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Do your dist-upgrade, probably you need to use -f or do the --force-remove from the above comments, if you have tried it with python 3 active, like I did.
After you have a clean install/upgrade, you can switch your python back, if you need python 3 as default:
root@web03:~>update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode
root@web03:~>python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Solution 2:
The package apport_2.20.1-0ubuntu2.4_all.deb
is the one causing problems, you should remove it sudo apt-get purge apport
Also python is throwing out errors about module configparser
install it via pip install configparser