–install-all-of-the-damned-deps-I-really-effing-mean-it

I hate yum. I hate apt-get. I hate urpmi. I really hate up2date and yast.

It’s blasphemous to say, but sometimes it’s the only possible emotion. Ordinarily, these tools are a miracle of modern software. It’d be nice if all of the distros could agree on the same miracle…yum for RPM-based systems, please, and apt-get will have to do for Debs, but that’s not my complaint today. My complaint today is with the fact that it is damned near impossible to convince any of these tools to install all dependencies with a single command and without asking any questions.

I know what you’re thinking. You’re thinking, “That’s their job. Of course they can do it, and I use it for just that purpose all the time.” But you’re wrong. And I know you’re wrong because I use them for that purpose and none of them work for some selections of packages, even when an acceptable resolution is available.

Here’s an example that applies to Fedora Core:

yum -y install caching-nameserver

When your BIND is not up to date. yum fetches the caching-nameserver package, sees that it needs a newer version of BIND, and bails with a fatal error. Did it bail because the newer version of BIND wasn’t available? No, it bailed because it wanted to bail. How about that “–install-all-of-the-damned-deps-I-really-effing-mean-it” option? It’d come in real handy right about now.

Just so you Debian and Ubuntu users don’t get all uppity and think you’re better than the RPM-based systems, try to non-interactively install a package that depends on postfix. It fails, despite postfix being available in the repository. The reason, I assume, is because exim is installed and exim is the super-exalted MTA on Debian and removing it non-interactively to resolve a dependency is not acceptable. Speaking of installing packages with apt-get non-interactively, do you know what kind of hoops you have to jump through to have it not stop and ask questions? apt-get not only needs an “–install-all-of-the-damned-deps-I-really-effing-mean-it” option, it also needs a “–you-better-not-ask-me-any-damned-question-about-it-either” option.

Just in case you think I’m overstating the problem, here’s how you install using apt-get without user interaction:

apt-get –config-file apt.conf.noninteractive -y –force-yes install

Holy crap! We need a “-y” and a “–force-yes”? Yep. Now, what’s in apt.conf.noninteractive?

APT::Get::Assume-Yes “true”;
APT::Get::Show-Upgraded “true”;
APT::Quiet “true”;
DPkg::Options {”–force-confmiss”;”–force-confold”};
DPkg::Pre-Install-Pkgs {”/usr/sbin/dpkg-preconfigure –apt”;};
Dir::Etc::SourceList “/etc/apt/sources.list”;

Holy crap, redux! Are you serious? There isn’t a one-letter option to get a quiet and non-interactive install with apt-get? I don’t know about you, but where I come from noninteractive is the default behavior of UNIX command line applications, and with good reason. Output is for errors. If you did what I wanted you to, I don’t need to hear anything about it.

Of course, apt-get isn’t the only guilty package manager, it’s just the most egregious example. yum has become more chatty, by default, in every major revision…it seems the technical users who speak up on mailing lists always want to see more output flying by, and developers always want to give it to them. It just confuses my users to see so much crap, so I’m filtering down the output as aggressively as I can in my scripts, as we speak. My users still get confused a lot, and so do I, particularly by the various dependency problems that pop up. The worst part is that these problems are extremely unpredictable; our install script might work one day and fail the next on the exact same system, even if no changes have been made to the system, because a new package rolled into the OS repository has different dependencies than the currently installed version. Actually, the worst part is that users either over-react to all of the output, believing it all to be errors, or they under-react, and watch serious errors go by without giving them a second thought. Oh, yeah, it also makes scripting with these tools very difficult.

I should make clear that we’re not dealing with broken or unavailable packages here (even though apt-get wrongly says that the postfix package is broken when you try to install a package that depends on postfix when exim is installed). We’re talking about OS-provided packages. They install without error when installed separately or via an update. But, without fail, every new OS and package manager that I work with has some quirk that prevents it from installing all of the packages we need with a single command. So, I have to have a two-stage process for all of them: install the deps, and then install the stuff that depends on them. yast is the worst, while yum is probably the best. But they all have issues that would probably be solved if the simply started thinking in terms of “what can we do to accomplish what the user asked of us without having to ask any questions?” It doesn’t even have to be the default, but if the user went to the trouble to stick a “-y” in there, take it as a given that they really wanted the dependencies installed without question or error if they are available.

And another thing, while I’m bashing package manager developers as a single entity. They’re kinda ornery about bugs. Sure, I’m all-around ornery most of the time, and you might assume that they’re just responding in kind (as would be their right), but when I file bugs I’m as sweet as sugar. I’m a developer myself, and I know that bugs are a difficult part of the process. I try to keep my bug reports friendlym concise, accurate, and I try to include all relevant details. The result has been less than stellar in almost every single case. Jeff Johnson, the RPM maintainer (which is not, strictly, in the same class as the other high level tools I’m speaking of, but I figured I’d pick on him anyway as it is trendy to do so lately), is renowned for surly responses to bugs, and I’ve tasted it more than a few times over the seven years I’ve been packaging RPMs. But I actually prefer Jeff’s surly but usually prompt response to what I’ve gotten from SUSE and Red Hat on rug and up2date bugs, which is effectively no response. SUSE closed a bug twice as a duplicate of a wholly unrelated bug, while Red Hat has had my up2date bugs open for over a year, one of which has no response at all in that time. Seth Vidal is a notable exception, as he has been extremely responsive and effective in dealing with yum bug reports. It’s no coincidence that yum is, by far, my favorite package management tool. When the system default package manager is just too broken to use (up2date and rug, at this time) I install yum to manage our packages. I don’t like the extra work, but they give me no choice.

And that’s all I have to say about that. I reckon I’m all bitched out for the day. I’ll feel much better tomorrow and I’ll be singing the praises of yum and apt-get from the highest rooftops. But you’ll never get me to say nice things about the package management features in yast–they’ve rightly taken those out and shot them. Unfortunately, they’ve replaced them with rug instead of yum, and introduced a whole new slew of problems.