13

I already have a package B and want to install a new package A. The installation wants to modify B, but I don't want that to happen.

I need to install the package A.

It has the a dependency on package B and requires to be (>2.0).

I have already installed B in my system with the version 2.1, so my current setup already fulfills the dependency.

But there is a new version (2.2) of the B package in the Debian repository and I don't want it since it conflicts with other stuff.

So, when I install the A package apt also tries to upgrade B.

How can I disable the upgrading of the dependencies or indicate an explicit dependency version without having to edit the packages?

I have read How do I get apt-get to ignore some dependencies?, but it doesn't help me. In the question there, the dependency (B) should not be handled by the repository manager at all. In my case, the repository manager already takes care of the dependency and should continue to do so, just not in this particular action.

Reopen Reviewers: Please see the comment of victorgp which should have been the answer in the first place.

Angelo Fuchs
  • 197
  • 1
  • 13
victorgp
  • 481
  • 2
  • 4
  • 9
  • 3
    Is not duplicated, so i'm going to anwser myself, use: --no-upgrade – victorgp Sep 28 '11 at 14:55
  • 1
    Try to formulate it more visible, more convincing. Show the easily verifiable, essential differences between the post and the dupe candidate. Only to say, "it is not a dupe", is only rarely enough. – peterh May 29 '17 at 18:54
  • 1
    @peterh I have edited it to be more precise. I had the impression that "The answers there won't help here, and the answers here won't help there" would be sufficient. – Angelo Fuchs May 30 '17 at 07:55

4 Answers4

4

On Debian 8 I've found the option --no-upgrade can help achieving the desired result. For example:

apt-get install --no-upgrade php7.0-xmlrpc
Andrii S.
  • 141
  • 3
3

You can try the --nodeps flag with apt-get or you can try the debian package utility, dpkg, with the option --ignore-depends.

David George
  • 888
  • 1
  • 9
  • 21
0

Use apt-mark hold package-that-apt-should-leave-alone.

hold

hold is used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed.

masterxilo
  • 119
  • 3
0

You can either use the --nodeps flag with apt-get or download the package and install it using dpkg along with the option --ignore-depends

George Tasioulis
  • 1,969
  • 2
  • 16
  • 17