2

I have a program with a debian package in my personal repository that depends on python-cherrypy3. However, version 3.5.0 of python-cherrypy3 shipped with Ubuntu 16.04 has a serious unfixed bug that stops my program from creating an HTTPS web server. I have put version 3.2.2 of python-cherrypy3 on my personal repository. Then put a

Depends: python-cherrypy3 (<< 3.2.5)

in debian/control file of my package. The bug starts from 3.2.5 version of cherrypy, so every version lower than this version is acceptable. But Ubuntu 16.04 apt-get cannot resolve the dependency and still prefers the newer version 3.5.

The following packages have unmet dependencies:
 my-package : Depends: python-cherrypy3 (< 3.2.5)
E: Unable to correct problems, you have held broken packages.

If I do apt-get install python-cherrypy3=3.2.2 and install older version of cherrypy from my repository, then the installation of my package works fine. Can I somehow make this automatically, so when someone issue an apt-get install my-package apt automatically installs the 3.2.2 version from my repository?

muru
  • 197,895
  • 55
  • 485
  • 740
Mohammad
  • 805

1 Answers1

2

This can't be done with just the dependencies on your package. Without special configuration, apt-get always prefers the highest version available, so, even if your package depends on python-cherrypy3 (<< 3.2.5), it will pick the highest version of python-cherrypy3 available. And since Ubuntu 15.10 and above have only 3.5.0+, that's what you'll get.

What you can do is provide a 3.2.5 version packaged of python-cherrypy3 in your personal repository, which uses an epoch number, so that it is preferred over the newer package. Then depend on that.

muru
  • 197,895
  • 55
  • 485
  • 740