Skip to content

Ubuntu

Fix apt packages

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.

Text Only
1
2
3
4
5
6
7
8
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

Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
> apt policy libedataserver-1.2-26

libedataserver-1.2-26:
  Installed: 3.44.4-0ubuntu1.1
  Candidate: 3.44.4-0ubuntu1.1
  Version table:
 *** 3.44.4-0ubuntu1.1 100
        100 /var/lib/dpkg/status
     3.44.4-0ubuntu1 500
        500 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy-updates/main amd64 Packages
     3.44.0-2 500
        500 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy/main amd64 Packages

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

Text Only
1
2
3
4
5
6
7
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:
  libedataserver-1.2-26

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.

Text Only
1
2
3
Package: *
Pin: release n=*
Pin-Priority: 1001

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.