Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a debian/control file, how do I specify a dependency on a package between 2 versions of that package?

For example: python 2.5 or higher but lower than python 2.7.

Depends: python ($VERSION_STRING)

What would $VERSION_STRING be?

share|improve this question
up vote 4 down vote accepted

The operators for version dependencies are:

>>  Greater than, but not equal to
>=  Greater than or equal to

(note < and >, meaning <= and >= also work, but they're depricated)

So in order to declare your example, you'd add two dependencies:

Depends: python (>= 2.5), python (<< 2.7)

For a full description of dependency declarations, see the Debian Policy Manual, Chapter 7. If you want to take a look at some uses, see this random example.

share|improve this answer

You can use two clauses to specify the constraints. The first states a dependency on python 2.5 or greater, and the second states a dependency on python earlier than 2.7.

Depends: python (>= 2.5), python (<< 2.7)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.