0

For various reasons, I'm running some Debian systems with, shall we say, odd sets of packages installed. It's becoming almost impossible to do apt-get install to install anything; apt is always complaining that A depends on B, but it is not going to be installed, or that C is broken, or something like that.

My question is, what's a good way to damn the torpedoes and go full speed ahead, installing the package's contents anyway? I know some partial techniques, but they're not always sufficient:

  • If the .deb file has been downloaded, I could find it in /var/cache/apt and install it by hand with dpkg -i, although I suspect even there I might be stymied (the install might fail) due to unmet dependencies.

  • I think there's a way to extract the contents of a .deb file by hand, although I can never remember it, and I'm pretty sure it's strongly discouraged, for the usual sorts of reasons.

  • I know I can theoretically use various techniques (e.g. equivs) to create some kind of a pseudo-package, but this seems like a lot of trouble.

Are there any other options? Does apt-get have an "ignore dependencies" switch that I've missed? I've seen references to --nodeps and --no-depsoptions, butapt` (at least on this system) doesn't seem to support them.

Or, side question, is there a way to force apt to at least download the .deb file, even when it knows it won't be able to install it? (I've been trying to use apt-get -d install, but it doesn't seem to be downloading anything.)

I've seen the previous question Ignore all dependencies for a specific package with apt-get, and it contains some answers, but I'm still searching for a better one.

[Footnote: No need to lecture me on what a bad idea this is, and that I shouldn't be trying to do it. I already know that. :-) ]

Steve Summit
  • 237
  • 3
  • 10
  • Out of curiosity... if you know for sure that package A depends on B and package A will NOT work due to unmet dependendancies (even if somehow you manage to do a botched installation) - what are you trying to achieve? Have you tried making from Source? Also if you put down your Debian version, and what package you are trying to install, someone here probably have stumbled similar/same problem and can give you more specific answer. – Darius May 30 '18 at 00:28
  • Making an equivs package takes one short command, how's that a lot of trouble? – u1686_grawity May 30 '18 at 04:37
  • @grawity As I understand it, `equivs` takes one command and then you have to edit a template full of all sorts of cryptic information which you might not understand. Am I missing something? – Steve Summit May 30 '18 at 10:28
  • @Darius It's not just one package I'm trying to install today; it's a problem that comes up all the time. It's typically more complicated than just "A depends on B". Typically A depends on B1 which is not going to be installed, but I've got B2 installed, but for inscrutable reasons `apt` is not satisfied. In general, I believe (or I hope) that A *will* work, and I want to at least try, but `apt` won't let me. – Steve Summit May 30 '18 at 10:33
  • @Darius *If you know that package A will NOT work...* Also, it's often the case that trying to run A, and observing its failure mode, might give vital clues as to what it might take to actually satisfy the dependency and get it to work. But, again, `apt` won't even let you try. – Steve Summit May 30 '18 at 12:12
  • "I'm still searching for a better one." better in what sense, specifically for something that is discouraged? What is "wrong" with `--force-depends`? – Patrick Mevzek May 30 '18 at 15:07
  • @PatrickMevzek "Better" in that it will allow me to make progress. I have a broken system. I need to install a package. `apt` knows where it is, but refuses to install it, refuses to even download the `.deb` file. So I'm completely and totally stuck. I can either wipe and reinstall my entire system (which is not an option) or I can try to find the sources to the package and build it myself from scratch. But `apt` can't help me *at all*. Or rather, it won't help me. There are things it could do for me, that would be convenient for me and that would save me time, but it refuses. – Steve Summit May 30 '18 at 16:00
  • @PatrickMevzek By `--force-depends`, do you mean the `dpkg` option? I'd use it, if I had a `.deb` file to install, but I don't. I was hoping `apt-get` could at least download it for me. – Steve Summit May 30 '18 at 16:01
  • `apt-get download`? or `--download-only` flag? – Patrick Mevzek May 30 '18 at 16:21
  • @PatrickMevzek `download` subcommand doesn't exist in the version on this system. I've been using `-d` exhaustively, but it's not downloading anything, I assume because dependencies aren't met. – Steve Summit May 30 '18 at 16:25
  • You did not specify what version you are using... – Patrick Mevzek May 30 '18 at 16:26
  • @PatrickMevzek apt version 0.8.10.3. (And thanks for your suggestions, I do appreciate them, even though they're not working. I probably shouldn't have asked the question in the first place, since the fundamental problem is that `apt` and I just don't get along, and shouldn't try.) – Steve Summit May 30 '18 at 16:28
  • If it is oneshot or manual is allowed you can always go to `packages.debian.org`, find the package you want, download it and then do a `dpkg -i` on it with some force flags. But indeed rereading your question seems to me that you arrived at some strange situation where things are broken and I believe your energy would be better spent to avoid this. Or you have alternatives for some specific application outside of OS management, like chroots, containers/VMs, or "snaps" which is a trend. Or just installing things directly from source, bypassing packages if you do not like `apt`? – Patrick Mevzek May 30 '18 at 16:39

0 Answers0