Debian help: solving an apt-get problem
June 4, 2006 7:52 AM   Subscribe

Debian's giving me grief when I go to install php5. Is apt-get dist-upgrade still scary and broken?

I'm trying to install php5 on my debian system. Using apt-get install gives me the following error:

E: This installation run will require temporarily removing the essential package e2fsprogs due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
E: Internal Error, Could not early remove e2fsprogs

Googling for answers, I have found the following suggestions:
1. "Try using aptitude to get around the dependency." Sadly, apt-get installing aptitude gives me the same error. I tried downloading the aptitude.deb package and installing directly, and quickly descended into a nightmare world of dependencies.

2. "Your system is out of date. Try doing an apt-get dist-upgrade." Well, ok, but googling around for info on apt-get dist-upgrade has shown me a host of problems that can occur when people do this. It looks fairly grim.

I'm running sarge at the moment. I wouldn't mind upgrading to etch, if I were confident that it wouldn't kill my system. I also wouldn't mind staying on sarge if I could solve the e2fsprogs problem. Also note that I'm doing this remotely, so it would be most convenient to find something that didn't kill the connectivity.

Thank you for any suggestions or advice.
posted by pornucopia to Computers & Internet (17 answers total) 1 user marked this as a favorite
I run apt-get -u dist-upgrade on a sarge box once a week. It's neither scary nor broken. That's the whole point of Debian's stable releases.
posted by majick at 8:00 AM on June 4, 2006

Look here.
posted by koenie at 8:06 AM on June 4, 2006

the problem is that several essential packages (initscripts, sysvinit etc.) depend on e2fsprogs.

I tried
dpkg --force-remove-essential -r e2fsprogs
and even then it would not do it.

dpkg --force-all -r e2fsprogs
did it.

(and yes apt-get install -f is a good thing, as koenie points out)
posted by dorian at 8:09 AM on June 4, 2006

Response by poster: koenie... I did read that question earlier, and forgot to include it above in my list of research activities. It looked to me like Jack of Saxons removed e2fsprogs, which pretty much messed up his system for a while, then figured out how to fix it. I was hoping there'd be a better solution that would never cause my system to enter a broken state. (Note that he's not able to connect via ssh anymore after removing that package!)

apt-get install -f is actually still giving the same error, too.

And majick, I found several articles talking about bugs in the update scripts for the sarge release that would break around 30% of debian systems.
posted by pornucopia at 8:14 AM on June 4, 2006

Response by poster: dorian - so I want to use dpkg to force an uninstall of e2fsprogs, then I want to reinstall the newer version of it, then do the apt-get upgrade?
posted by pornucopia at 8:15 AM on June 4, 2006

pornucopia -- the apt-get upgrade will install it anyway as other packages depend on it. so you could either install it then do the upgrade, or simply do the upgrade. either way should be fine I think.
posted by dorian at 8:18 AM on June 4, 2006

then again e2fsprogs issue could be a red herring and a symptom of larger dependency hell issues ^_^
posted by dorian at 8:19 AM on June 4, 2006

hm no I was wrong, upgrade will not automatically pull e2fsprogs. but install -f does. but if install -f is still broken for you, then yeah you will have to manually install e2fsprogs after you remove it.
posted by dorian at 8:23 AM on June 4, 2006

Best answer: The php5 packages available from shouldn't give you that dependency problem.
posted by Eater at 8:25 AM on June 4, 2006

Best answer: Use the php5 packages from dotdeb, linked above.

Let's see how I can describe the dangers of dist-upgrade... There are two separate possible problems. Problem 1 goes something like this: you're upgrading a set of programs dependent on each other, but you're upgrading to an incomplete set. That is, you're upgrading ABCDE, but the upgrade target contains new versions of ACDE. So when you upgrade, you find that your programs no longer work, because they're waiting on a new version of B that doesn't actually exist. Debian is supposed to prevent this, but doesn't always.

The second problem happens when the upgrade removes something unrelated. You upgrade ABCDE and Q gets removed - maybe because there's a newer version of Q, or there's a new package you don't know about called Q-Prime, or whatever the reason may be. Debian can't really avoid this, it's a user issue.

The solution is to PAY ATTENTION to what apt says it's going to remove when you dist-upgrade. Look at all the to-be-removed packages. Do any of them look important? If the upgrade is removing "libimportant2" and installing "libimportant3", that's almost certainly okay. But if it's removing "libimportant2" and not installing anything, that's quite possibly bad. You can use apt-cache show to find out the details on any package, figure out whether it's important or not, before you finally run the apt-get dist-upgrade. Another good trick is sometimes picking the order of things to install - try specifically installing (upgrading) certain packages first, usually the most basic ones that others depend upon:

apt-get install foo
apt-get install bar
apt-get dist-upgrade

This can make dist-upgrade go much smoother, because you've already pre-upgraded the base packages that others depend upon.
posted by jellicle at 9:25 AM on June 4, 2006 [1 favorite]

Response by poster: Eater, thank you for the link to the php5 package, I'll try that.

jellicle, thank you for the tutorial on executing a smooth apt-get dist-upgrade. Do you have any advice on the e2fsprogs issue? I ask because apparently some other things are going to run into the same issue, like aptitude.
posted by pornucopia at 9:44 AM on June 4, 2006

Response by poster: Here is some harrowing discussion on the problem that makes me afraid to try the solution that worked for the thread commenter.
posted by pornucopia at 11:28 AM on June 4, 2006

Response by poster: This thread makes me think that the harrowing solution may be the only one.
posted by pornucopia at 11:31 AM on June 4, 2006

Hm, I use apt-get -f dist-upgrade regularly on sarge to grab DSA packages. I also did the same on woody, and to upgrade from woody to sarge. I've had no personal problems with dist-upgrade.
posted by NucleophilicAttack at 5:17 PM on June 4, 2006

This may be a blasphemous suggestion, but I've been running a server based on Debian for a few years, and I generally prefer to compile from source the more critical applications that I use. This includes the kernel, mySQL, Apache, PHP, and others. Building things this way generally makes it easier for me to work around these types of dependency problems. I can upgrade immediately if there are security issues with a current version or a new feature that I want to use right away, and all the various and sundry compile-time options I could want to use are never more than a quick rebuild away. I stick to Debian's packages for the basic stuff.
posted by autojack at 8:05 PM on June 4, 2006

Best answer: Running a dist-upgrade on your system is never an inherently dangerous thing to do. Nor is it ever inherently safe. dist-upgrade just tries to figure out a good way to make your system up-to-date, and then offers to run those changes for you. Whether it's safe to do that or not depends on a number of things: the details of those changes, whether or not there are any bugs in new packages, etc.

I'd wager that the number of computers that run dist-upgrade daily is on the order of hundreds of thousands. I run Debian unstable on my laptop, I dist-upgrade every morning, and I don't remember the last time it gave me any real problem. At work, I help oversee around 20 servers running Debian; we dist-upgrade them when there are security updates available, and I don't think they've ever given us problems in my two years there. The overwhelming majority of the time, it runs without a hitch, and you never hear about that. The reason you can find a lot of horror stories about dist-upgrading on the web is because when things to do go wrong, they tend to fail pretty spectacularly, and people send mail about it.

Since you're running the current stable Debian release (sarge), a dist-upgrade ought to be very safe. The only changes it should ever try to make are ones which are security-related or fix other critical bugs. And any new packages you'll get have undergone extensive testing. So, you should not be afraid to dist-upgrade.

However, I'm guessing that if you try to dist-upgrade, it'll likely fail with the same error that you get when you try to install php5 or aptitude. It seems that apt-get has decided that it really needs to uninstall e2fsprogs, and I doubt it'll be satisfied until that situation gets resolved.

Try running apt-get -f install. apt-get should show you everything that it wants to install, upgrade, and remove; see the apt-get man page and look at the documentation for the -f option to get details. Hopefully that will give you some context to try to understand why it wants to remove e2fsprogs; for example, maybe it's trying to install a package you requested a while back that conflicts with e2fsprogs, for some crazy reason.

It will also try to fix broken dependencies, so it's possible that it'll just want to upgrade some packages, and maybe install a couple of new ones, and not remove e2fsprogs. If that's the case, I suggest you let it do its job; afterwards, you should be able to install php5 just fine -- or at least you'll have a different problem stopping you. ;)

If it's still showing you that it wants to remove e2fsprogs, well, figuring out how to fix that will depend on exactly what information it shows you. This is the sort of knowledge you get primarily by running sid on your desktop for a few years. :) But if you ask nicely on a mailing list like debian-user, and show them what apt-get is proposing, a guru may be able to help you.

Good luck.
posted by brett at 9:10 PM on June 4, 2006

Response by poster: Well, based on my reading in the newgroups earlier, I set the source lists to "stable", and I did an apt-get dist-upgrade. I left for a few hours, and just came back to find that the box isn't responding to any network traffic. I'll have to investigate further in person. Oh well. Thanks for the advice everyone.
posted by pornucopia at 9:42 PM on June 4, 2006

« Older Citing an unpublished manuscript   |   How do I stop my pooch from chewing on my... Newer »
This thread is closed to new comments.