[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-get install refuses to installs older versions of dependencies



On Mon, Jul 01, 2019 at 07:32:20AM +0000, Fabian peter Hammerle wrote:
> Dear Debian Users,
> 
> 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

[...]

> 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`.

That is most probably the only "clean" option there is...

[...]
> 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).

That said, there is an option (heh) to apt-get you might want to
try. From the man page:

  --allow-downgrades
      This is a dangerous option that will cause apt to continue
      without prompting if it is doing downgrades. It should not
      be used except in very special situations.  Using it can
      potentially destroy your system! Configuration Item:
      APT::Get::allow-downgrades. Introduced in APT 1.1.

The problem is that other packages might depend on your bar=4.0.0
package. Downgrading that might either break that other packages
or worse, send your Debian into a downgrade landslide (imagine
for a moment your 'bar' is, e.g. libc6...). This can get particularly
ugly, because downgrade paths aren't as well-tested as upgrade
paths (think config files, data files in new formats not understood
by older versions of your program, yadda, yadda).

So it makes a hell of a lot of sense to not do it by default.

Me, at least, having had my own share of "upgrade landslides" (yeah,
I asked for it: playing with FrankenDebians is the only way to
really learn things, at least for stubborn folks like me ;-)
I do understand the stern warning in the man page above.

Let us know how it went :-D

Cheers
-- tomás

Attachment: signature.asc
Description: Digital signature


Reply to: