I upgraded from Bionic to Cosmic by editing /etc/apt/sources.list replacing all occurences of bionic by cosmic and then running
sudo apt update sudo apt dist-upgrade
After some time the error occured and I cleaned up with
sudo apt install -f
and completed the upgrade with another
sudo apt dist-upgrade
which this time completed without errors.
In the end I did
sudo apt autoremove
to finish up.
So the error occured only once and after cleaning up I could complete the upgrade.
I upgraded from Bionic to Cosmic by editing /etc/apt/ sources. list replacing all occurences of bionic by cosmic and then running
sudo apt update
sudo apt dist-upgrade
After some time the error occured and I cleaned up with
sudo apt install -f
and completed the upgrade with another
sudo apt dist-upgrade
which this time completed without errors.
In the end I did
sudo apt autoremove
to finish up.
So the error occured only once and after cleaning up I could complete the upgrade.