Sometimes when installing apt packages, we get an error saying package can't be installed as it depends on some other package which is not available. I tried installing libedataserver which is required for Gnome Task Widget. However, I was shown the following error in my terminal.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gir1.2-edataserver-1.2 : Depends: libedataserver-1.2-26 (= 3.44.4-0ubuntu1) but 3.44.4-0ubuntu1.1 is to be installed
Then I listed available versions for libedataserver-1.2-26
I saw that version 3.44.4-0ubuntu1.1 was installed and it was available in any repository. I tried installing version 3.44.4-0ubuntu1 but again got following error message
The following packages will be REMOVED:
chrome-gnome-shell evolution-data-server gdm3 gnome-calendar gnome-contacts gnome-session gnome-shell gnome-shell-extension-appindicator
gnome-shell-extension-desktop-icons-ng gnome-shell-extension-prefs gnome-shell-extension-ubuntu-dock gnome-shell-extensions
gnome-shell-pomodoro gnome-todo libebackend-1.2-10 libebook-1.2-20 libebook-contacts-1.2-3 libecal-2.0-1 libedata-book-1.2-26
libedata-cal-2.0-1 libedataserverui-1.2-3 libfolks-eds26 ubuntu-session
The following packages will be DOWNGRADED:
I did't want to remove any packages. And downgrading libedataserver would remove all these required packages. I searched the internet and stumbled upon a similar issue on stackoverflow.
I followed the advice posted on stackoverflow, and created a new file named /tmp/a_p with the following content. This file basically sets priority for apt packages. It sets the highest priority for live packages in repositories.
Pin: release n=*
And then executed sudo apt-get -o Dir::Etc::Preferences=/tmp/a_p dist-upgrade. Voila! All my packages were fixed and I was able to install Gnome Task Widget.