I'm building my first debian package (django), which needs some dependencies, so I was wondering if it's possible to install a specific package version with apt-get.

For example instead of

pip install gunicorn==19.3.0

apt-get install gunicorn==19.3.0

(which obviously doesn't work, only apt-get install gunicorn works, however then it will install the latest version)

Ultimately, this is supposed into the Depends section of the control file.

Any ideas?

  • You can also use dpkg to install any downloaded version or see here on how to fake a version askubuntu.com/questions/18192/…
    – mchid
    May 28, 2016 at 1:41
  • 19.3 does not seem to be available through apt-get unless you have a ppa which provides this version.
    – mchid
    May 28, 2016 at 1:42

1 Answer 1



man apt-get 

and go down (/) to the install function. This is worth reading.

By the way, did you try the following?

sudo apt-get install gunicorn=19.3.0

(one equal sign, not two)

As the man page states, use this feature with care. I don't know why you'd want an older version of a package on your installation but I'd guess that it would be a lot easier in the long run to change the dependent package to rely on the latest version of a dependency (gunicorn?) and not keep using an older version. Cleaner, IMO.

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