I manage an apt repository, for package PACKAGE, which has dependency (DEPENDENCY<<1.2). Both PACKAGE and DEPENDENCY are available in my repository.

We just released a version of DEPENDENCY (version 4.0.0), and now installing the same PACKAGE on a completely clean machine fails with the error:

The following packages have unmet dependencies:
 PACKAGE : Depends: DEPENDENCY (< 1.2.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

If I check the versions of DEPENDENCY available, I can see that there are known packages which meet the << 1.2 requirement:

sudo apt list -a DEPENDENCY
Listing... Done
DEPENDENCY/stable 4.0.0 all
DEPENDENCY/stable 1.1.12 all
DEPENDENCY/stable 1.1.11 all
DEPENDENCY/stable 1.1.10 all

Since I actually manage the package AND the dependency I can fix this on the repository side, but how? Why doesn't apt recognise the correct dependencies?

(Doing apt --fix-broken won't work because the packages are somehow broken on the server side).

2 Answers 2


APT doesn’t resolve versions of packages based on requirements, but rather based on availability (and priorities). Put another way, it is really designed to work with coherent repositories, i.e. repositories with single versions of packages, where all related packages can be installed with the versions in the repository. (That’s how the Debian repositories work most of the time, and is a requirement for the release repositories.)

Even though DEPENDENCY is available in multiple versions in the same suite, APT will consider the highest version only, 4.0.0, unless told otherwise.

You’ll probably need to help APT resolve the situation manually:

apt install PACKAGE DEPENDENCY=1.1.12

and even then I’m not 100% sure that will work.

As a general solution, you’d have to use different suites in your repository, and make sure PACKAGE and DEPENDENCY are present in mutually-acceptable versions in the same suite; version 4.0.0 of DEPENDENCY would therefore go in a different suite, without PACKAGE, until PACKAGE is available in a compatible version.

  • thank you for the reply! It looks as though I should rethink the whole structure of my repository.
    – jenny
    Dec 12, 2019 at 15:37

I found the problem I was having was that I changed the download source for packages. in settings > about > download source. I changed it to a server nearer to my location as this enhanced faster app downloads particular for flatpak packages.

I solved it by returning the setting back to "main" and everything worked brilliantly. I experienced this problem when i was trying to install barrier, a program that allows you to share your mouse across different devices and cross operating systems.

  • Your answer seems to be in the viewpoint of someone using a particular repository. But the question was about fixing the problem as someone managing that repository.
    – telcoM
    Sep 12 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .