Raspberry pi is based on Debian distribution. This article may assist apt repository upgrade failures. When ever there is a broken install, you can use the below command.
apt –fix-broken install
Whatever library it depends on use the below command to resolve it.
dpkg –force-all –configure -a
dpkg –purge –force-depends <library package name>
apt –fix-broken install
apt-get -f install
Source: debian – How to solve this Dependencies apt –fix-broken install – Super User