Some background information:
As you may know, in a Debian package, there may be alternative dependencies, written in the CONTROL file as Depends: apache2|something-else
, for example. How does apt
select which dependencies to choose, and how can I override this so I can minimize download size?
I'm on a slow connection on some locations and need it to use the smallest total download size. How can I force it to do so?
Edit: I'm not asking about skipping recommends.
Edit 2: I am not asking about skipping dependencies. I am trying to get all dependencies, just in the smallest total size, especially noting and deeply traversing package1|package2
choices.
Edit 3: A grep
or otherwise shell script is acceptable.
Unfortunately, since the current answers do not really answer the question, they can't really get the bounty. It's still out there for someone willing to write a bash script!
Edit 4: Although the bounty has been awarded to a good answer which I encourage you to upvote, I am still seeking a more concrete answer. If it also elegantly handles virtual packages provided by one or more packages, then I'll possibly give another after-the-fact bounty to award that answer.
You could always have apt list all the dependencies then by hand you could install the packages that you would rather install but I've searched man pages and several forums but I could not answer your exact question other than rewriting the source to apt that's how opensource works anyways.
As far as I know, there is no way to optimize that. Most things are already greatly compressed, so you don't download nearly the whole file size. (Next time you install a package, take a look at the difference between the amount of data to be downloaded and the total hard drive space to be consumed.)
If you know what you're doing, (e.g., you already installed
foo
, but it says that you need to reinstall it,) and want to leave all the dependencies off when you install a file, add the flag--no-install-recommends
.Some of the answers to this question explain how to install specific packages without the dependencies. They covered it quite a bit deeper than I did, so if you're still having trouble or my answer didn't solve your problem, I'd recommend taking a look at that thread.
I think you're confusing how dependencies work. If something is dependent- then by definition it is needed. I suppose what you could do is find out exactly which files from the dependency the app you want is using... and remove everything that it doesn't call.. but that seems like a lot of work for a few megabytes..
You seem to be asking for a car that will still drive missing a 4th wheel(let's say the 'back-left', for the sake of this metaphor),to save on weight. At some point you're going to need to turn Right. The car will still roll, but only with certain functionality... by not installing the 'Recommended' i think you are going as light as safely possible with out having to delve into development.