For old Ubuntu 20.04 and Ubuntu 22.04 with Ubuntu Pro enabled for extended 5 years of Extended Security Maintenance (ESM) updates support, it might sometimes cause 3rd party apps refuse to install and even output unmet dependency issue.
This is because ESM apps have higher package priority 510, while most others are default to 500.
When trying to install an app package using apt
command, if the ESM app repository includes a copy of that app package (usually old) or a package that app depends on, then it will try to install the one from ESM rather than newer version from PPA or any other 3rd party repository.
It’s great for security! But what if you really want the ones from 3rd party repositories.
For example, when trying to install GIMP 3.0.x or libheif
library from a third-party PPA in Ubuntu 22.04 with Ubuntu Pro enabled, it may output unmet dependencies issue as the screenshot below shows you, as it tries to install the one from ESM.
To workaround the issue, you have few choices:
- Specify package source in
apt
command to tell where to install the package from. - Set higher priority for the third-party packages.
Option 1: Specify which source to install from in apt command
When installing app package via apt
command, you may specify which source to install the package from.
In the case, I was going to install GIMP 3.0.x from PPA, but it’s kept back due to libheif1
. Run the command below fixed the issue:
sudo apt install gimp libheif1/jammy
Here libheif1/jammy
tells APT to look for the libheif1
package from Ubuntu ‘jammy’ (22.04) release repositories, including standard Ubuntu repositories, PPAs, but NOT ESM.
These repositories have same priority, so the one with higher version number will be installed. And, you may replace jammy
with focal
for Ubuntu 20.04, or noble
for Ubuntu 24.04.
For choice, you may use -t
option instead. Which set target release with priority 990, and override the general priority settings in /etc/apt/preferences
.
First, run the command below in terminal:
apt policy
Then find out the ‘release’ key or ‘origin’ for the target PPA or software source. For PPA, usually find out and copy the “o=LP-PPA-xxx-xxx
” part. In my case, it’s o=LP-PPA-ubuntuhandbook1-gimp-3
.
Finally, install the package with example command below:
sudo apt install gimp libheif1 -t "o=LP-PPA-ubuntuhandbook1-gimp-3"
Option 2: Set higher priority for your PPA or package source
Without running the command with -t
option every time, and if you want to receive updates using “Software Updater”, you may set a higher priority from the package source.
1. First, also run the command below to find out the release key for your PPA or package source:
apt policy
2. Then, run command to create a custom configuration file under /etc/apt/preferences.d
directory and edit it.
sudo nano /etc/apt/preferences.d/myppa
When file opens, paste the 3 lines below
Package: * Pin: release o=LP-PPA-ubuntuhandbook1-gimp-3 Pin-Priority: 520
Here replace release o=LP-PPA-ubuntuhandbook1-gimp-3
accordingly, then press Ctrl+S to save and Ctrl+X to exit.
3. When done, run sudo apt update
to refresh package and finally install the target package as usual.