1

When I want to install a package, but that package depends on a package version older than what is installed on my system, how can I determine whether downgrading the package will break any other packages that may have depended on a higher version?

I've had to do this for a lot of packages since reinstalling Ubuntu 12.10 over 12.04. is that a related problem?

What I've tried:-

  • Searching Ubuntu Forums and AskUbuntu (not relevant questions)
  • Googling (again, gives irrelevant or no results)
  • Trying it out for myself (couldn't find a set of suitable packages to try on)

I apologize if this question has been asked before already on this site as I probably hadn't framed my searches with the correct terminology. 10x.

  • If the older version is in the official repos for your Ubuntu release, this information should be present when you try to install it. When you do apt-cache show <package-name> there should be a line starting with Conflicts: or Breaks: if it conflicts/breaks something. If the package you are trying to install isn't official (from a private PPA, for example) you are better off googling for possible caveats (the alternative is risking to break your system). – edwin Jul 02 '13 at 15:56
  • @edwin: 10x for replying. But I didn't get what you're saying. Could you please elaborate a bit more? Maybe convert your comment into an answer? – Yatharth Agarwal Jul 03 '13 at 15:42

1 Answers1

2

Let's take evince and gedit as examples. Open a terminal and run:

apt-cache show evince | grep Conflicts
apt-cache show evince | grep Breaks

This pair of commands will tell you if evince breaks or conflicts with something else. In my case I get

$ apt-cache show evince | grep Conflicts
Conflicts: evince-gtk

$ apt-cache show evince | grep Breaks
<blank>

so evince conflicts with evince-gtk that means they shouldn't be installed at the same time (APT will complain if this ever happens).

In my case evince doesn't declare to break any package so let's skip to gedit. Now, run

$ apt-cache show gedit | grep Conflicts
<blank>

$ apt-cache show gedit | grep Breaks
Breaks: gedit-plugins (<< 2.91)

As you can see gedit does not conflict with anyone. Nonetheless, it does break the package called gedit-plugins for versions strictly less than 2.91. That means gedit-plugins most be more recent than this version to work correctly with gedit and in particular APT will refuse to install gedit unless you remove gedit-plugins (<< 2.91) first.

Notice that even though the gedit-plugins in the official repositories are recent enough, you might want to download (from github maybe) a particular GEdit plugin that is older, this line serves you as a remainder that this older version should not work with the current GEdit version.

For more details about package relationships (and the official definitions of Breaks and Conflicts) refer to Debian Policy Manual - Chapter 7.

edwin
  • 3,799
  • 20
  • 33
  • I still don't get how to achieve what I want. Suppose I A depends on B <= 2.0 but I have B installed, how can I find out whether there is any package C that depends on B >> 2.1? – Yatharth Agarwal Jul 05 '13 at 06:45
  • I think the Break workflow that you've mentioned achieves the reverse of the test I want to perform. – Yatharth Agarwal Jul 05 '13 at 06:49
  • Sorry if I am mistaken BTW... – Yatharth Agarwal Jul 05 '13 at 06:50
  • Well, there are two alternatives B >> 2.1 replaces and breaks B <= 2.0, that should imply by transitivity that C breaks A. Otherwise B >> 2.1 can live with B <= 2.0, so that C and A can possibly live together, too. But with that comment I am guessing you want to know about reverse dependencies (so you can check if someone depends on B >> 2.1). Look at How do I find the reverse dependency of a package?. And tell me if I am correct to mark this as duplicate, please. – edwin Jul 05 '13 at 12:24