Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What are you talking about? dpkg will not remove packages with dependencies unless you force it to:

  root@fw:~# dpkg -P libssl1.0.0 
  dpkg: dependency problems prevent removal of libssl1.0.0:amd64:
   python-openssl depends on libssl1.0.0 (>= 1.0.0).
   openssh-client depends on libssl1.0.0 (>= 1.0.1).
   ntp depends on libssl1.0.0 (>= 1.0.0).
   
  ...SNIP...
   
   bind9-host depends on libssl1.0.0 (>= 1.0.0).
   tor depends on libssl1.0.0 (>= 1.0.1).
   tcpdump depends on libssl1.0.0 (>= 1.0.0).
   libruby1.8 depends on libssl1.0.0 (>= 1.0.0).
   postfix depends on libssl1.
  dpkg: error processing libssl1.0.0:amd64 (--purge):
   dependency problems - not removing
  Errors were encountered while processing:
   libssl1.0.0:amd64
or

  root@fw:~# dpkg -P coreutils 
  dpkg: error processing coreutils (--purge):
   This is an essential package - it should not be removed.
  Errors were encountered while processing:
   coreutils


Take a look at --force-help for more info on forcing things.


Okay but it doesn't change my point: better use apt-get.


You said: "In general it's not good to use that command because it can leave your system in an inconsistent state -- when there are packages which depend on the package you just removed."

I demonstrated that dpkg will not remove packages with dependencies. Furthermore some packages are so crucial (ie: essential) that dpkg does not even bother checking dependencies before erroring out.

How does that not change your point?


The reason I gave was incorrect (I was confused with what happens when you install a .deb file without installing its dependencies), but the point of apt-get being better than dpkg for this still stands.


I wonder what point you're talking about. The one and only point you made was that dpkg force removes packages at runtime and it doesn't do that. What other point is there?


It's right there in my comment:

> the point of apt-get being better than dpkg for this still stands.


That's you saying there is a point. That's not you telling us what the point is.


What I don't understand is why apt-get is better than dpkg. You haven't explained that.


Your unsubstantiated claim still stands...


I don't understand why you're making such a big fuss about this rather inconsequental point. All I'm saying is that you should generally use apt-get and not the lower level tool dpkg. I used an incorrect justification for that (removing doesn't lead to an inconsistent state), but you still should preferrably use apt-get. Let's get back to debating more interesting stuff now.


That's just wrong.

When removing packages it just doesn't matter. When installing, it also doesn't really matter. dpkg can't fetch packages from the repositories, but it will mark them and a following apt-get install -f will fetch them flawlessly.

A few years ago you had to be careful when mixing apt-get and aptitude, and thus probably also when mixing aptitude with dpkg, as far as i know that is not the case anymore. Even a following autoremove should work.

You haven't mentioned one single valid cause why it should be wrong to use dpkg, and I'm pretty confident that you won't, because afaik it isn't. And i'm pretty sure.

(Just jumping in because dfc mentioning he really wants to know. Just think about apt-get as a frontend for dpkg which calls dpkg to install and remove .debs, but also fetches them from the internet and notices when they are no longer needed because they were installed as a dependency for a now removed package.)


I'm not the only one that thinks your claim is left wanting. I cannot speak for them but I am interested in why you think apt-get is preferred over dpkg in this case because I am a decade long loyal user of Debian. My original point was that the dpkg command is shorter and that is why I have used it over the longer apt-get invocation. I am generally interested in learning more about Debian. If the way I have been doing things is wrong I would like to know why so that I can improve my skills. Does that make sense?

I'm not being snarky, I'm generally interested in learning more about Debian and it seems that you might be able to improve my knowledge.


Okay fine "wrong" is perhaps too strong, it's rather "not appropriate/ideal". My point was simply that dpkg is lower level, so it should not be the go-to tool for normal users. The comment which started all this was the comment suggesting a command with "dpkg" was 'better' (because it was a few characters shorter I suppose), and I merely chimed in to point out that that was probably not a good thing to say, thinking of how this lower level tool provides more potential for mucking up your system; e.g., accidentally trying to remove an essential package; I believe dpkg wouldn't ask for confirmation right? Also new users would probably be overwhelmed by all the options of dpkg.

The only time I've been forced to use dpkg in the past ten years was when the system was seriously messed up e.g. in the middle of a failed upgrade.


> "this lower level tool provides more potential for mucking up your system; e.g., accidentally trying to remove an essential package; I believe dpkg wouldn't ask for confirmation right?"

Did you read anything I wrote? I specifically mentioned that dpkg would not remove an essential package...twice:

In my initial reply I demonstrated that dpkg would not remove an essential package:

  root@fw:~# dpkg -P coreutils 
  dpkg: error processing coreutils (--purge):
   This is an essential package - it should not be removed.
  Errors were encountered while processing:
   coreutils
And in my second reply I simply restated what my example had demonstrated:

"Furthermore some packages are so crucial (ie: essential) that dpkg does not even bother checking dependencies before erroring out."

> "The only time I've been forced to use dpkg in the past ten years was when the system was seriously messed up e.g. in the middle of a failed upgrade."

Just because the only time you had to use dpkg was when your system was messed up does not mean that dpkg is likely to mess up your system. Its like saying that the emergency room causes life threatening trauma because the only time I was seriously injured I had to go to the emergency room.

Does anyone know if there a name for this kind of fallacious reasoning? It seems like an amalgamation of "post hoc ergo propter hoc" and "cum hoc ergo propter hoc."


Yes, in this particular case dpkg will behave perfectly well.

The OP is, I believe, trying to argue that apt-get is in general less likely to blow your foot off, therefore you should default to using apt-get in general since it makes you less likely to lose a foot in the long run.

If you prefer to memorise specific safe cases for brevity of typing, that's absolutely fine. The OP, I think, prefers not to do so, and the same goes for me.

Assuming I'm correct in describing the OP's argument, hopefully you can now both go "oh, okay, that's what he meant" and move on :)


As a Debian user, you should be using aptitude instead of apt-get anyway :)


I know. Most of it is just a matter of aptitude not being around 12 years ago. I really like the search and install related packages functionality of aptitude.


Stands on what exactly?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: