Repairing python setup
You have installed Python packages that are more recent than what your distribution provides. For example, you have python
version 2.7.10-1 installed but your distribution only has version 2.7.5-5ubuntu3.
APT doesn't downgrade packages unless explicitly told to do so. So for example if you try to install a package that depends on the exact version of Python, it won't work, because the python
package can't be downgraded. Even apt-get --reinstall install python
fails because APT won't downgrade Python to 2.7.5.
In order to repair your system, you need to allow APT to perform downgrades. To do that, define APT preferences. Create a file /etc/apt/preferences.d/allow-downgrade
containing
Package: *
Pin: release o=Ubuntu
Pin-Priority: 1001
The files in /etc/apt/preferences.d
(plus /etc/apt/preferences
) contain priority declarations that override the default selection when multiple versions of a package are available, which is “prefer the latest version from the target distribution”. Giving a package a priority over 1000 causes it to be preferred even if it's an older version that a package with a lower priority. Installed packages have priority 500 so the package from Ubuntu wins. For more information see:
man apt_preferences
I think once you've set these priorities you can run
apt-get update
apt-get upgrade
to downgrade all your packages to the version in Ubuntu (packages not in Ubuntu won't be removed). Also run apt-get -f install
and don't try to install any other software until this completes successfully.
Once everything is downgraded, remove the preferences file and run apt-get update
again.