Re: apt-get install refuses to installs older versions of dependencies
On Mon 01 Jul 2019 at 07:32:20 (+0000), Fabian peter Hammerle wrote:
> I set up an APT repository containing 2 packages: foo and bar
> The repository contains 2 versions of foo: 1.0.0 and 2.0.0
> and 2 versions of bar: 3.0.0 and 4.0.0
> foo 1.0.0 depends on bar 3.0.0
> foo 2.0.0 depends on bar 4.0.0
> I can easily install the latest version of foo via
> $ sudo apt-get install foo
> The following NEW packages will be installed:
> foo bar
> Setting up bar (4.0.0) ...
> Setting up foo (2.0.0) ... ```
> I get the same result when running `sudo apt-get install foo=2.0.0`
> However, apt-get fails to install foo 1.0.0
> $ sudo apt-get install foo=1.0.0
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Some packages could not be installed. This may mean that you have
> requested an impossible situation or if you are using the unstable
> distribution that some required packages have not yet been created
> or been moved out of Incoming.
> The following information may help to resolve the situation:
> The following packages have unmet dependencies:
> foo : Depends: bar (= 3.0.0) but 4.0.0 is to be installed
> E: Unable to correct problems, you have held broken packages. ```
> Currently, I workaround this issue by running `sudo apt-get install foo=1.0.0 bar=3.0.0`.
> How can I instruct apt-get to automatically install an older version of bar as required by foo?
Presumably by employing the same method that linux-image uses:
by moving/copying the version number into the packages' names,
foo-1 and foo-2.
> Or in other words: How can I make `apt-get install foo=1.0.0` install both foo 1.0.0 and bar 3.0.0 (dependency of foo 1.0.0).