LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   What is the difference between dpkg and aptitude/apt-get? (https://www.linuxquestions.org/questions/debian-26/what-is-the-difference-between-dpkg-and-aptitude-apt-get-423751/)

Akhran 03-11-2006 03:38 AM

What is the difference between dpkg and aptitude/apt-get?
 
When installing a software via 'dpkg -i packageA.deb', will the dependencies required by packageA be downloaded and installed automatically (aka aptitude/apt-get ) or are all the required dependencies already built into packageA.deb package?

Thanks !

vharishankar 03-11-2006 04:29 AM

dpkg will not install the dependencies. You have to do it manually... apt-get will do both for you (download and install dependencies).

David the H. 03-11-2006 06:54 AM

dpkg handles the basic low-level install/uninstall and configuration routines. Apt sits on top of it to add downloading, dependency handling, and other usability features. Aptitude, Dselect, Synaptic and such are all gui or ncurses frontends for Apt.

vharishankar 03-11-2006 07:52 AM

Now the difference between Aptitude and Dselect might be more relevant. At least I would be interested in knowing...

rickh 03-11-2006 09:13 AM

Quote:

Now the difference between Aptitude and Dselect...
The new book, The Debian System, goes into great and enlightening detail about that and other subjects ... I'm about half way thru it cover to cover. Will write a review when I'm at least 3/4 through. Great book, tho, for serious Debian users.

johnMG 03-11-2006 01:54 PM

David the H. wrote:
> dpkg handles the basic low-level install/uninstall and configuration routines. Apt sits on top of it

I'm not so sure about that... It looks as if both apt and dpkg are considered "low-level" commands, somewhat separated from each other (except that they both use the same underlying deb packaging db/system). dselect {shudder :) } is the front-end for dpkg. aptitude and syntaptic are front-ends for the apt tools.

You just don't think of apt-get as a low-level command because most folks use it all the time as the usual way to manage packages.

rickh 03-11-2006 02:10 PM

I think David the H is a little closer to the truth there. dpkg does the actual installations, apt sits on top of that, and handles dependencies. At the very top is aptitude, well worth studying. aptitude is to apt as deselect to dpkg, but that's a vast understatement. It is a substitute for, and an improvement upon apt, and will eventually probably be the foundation for apt's replacement.

As johnMG said, dselect=shudder ... aptitude=smile ... /usr/share/doc/aptitude/README.gz

divukman 03-11-2006 05:25 PM

I always use "aptitude install xxx". Why? Well aptitude remembers the dependencies installed with the package xxx and when you remove the package eg "aptitude remove xxx" or "aptitude purge xxx" then all the packages that were installed with the xxx (dependencies) will be removed too. Apt-get does not remember those packages, meaning you get a lot of useless packages on the system. Dpkg part you already know.

johnMG 03-13-2006 09:30 AM

divukman, if using apt-get, you can then use deborphan and debfoster to keep your system clean of un-used packages. Didn't know aptitude had that functionality built-in though.

divukman 03-13-2006 10:56 AM

Quote:

Originally Posted by johnMG
divukman, if using apt-get, you can then use deborphan and debfoster to keep your system clean of un-used packages. Didn't know aptitude had that functionality built-in though.

tnx,
no I've never heared of deborphan, so I just settled with aptitude :)

RodWC 03-13-2006 04:12 PM

Quote:

Originally Posted by divukman
I always use "aptitude install xxx". Why? Well aptitude remembers the dependencies installed with the package xxx and when you remove the package eg "aptitude remove xxx" or "aptitude purge xxx" then all the packages that were installed with the xxx (dependencies) will be removed too. Apt-get does not remember those packages, meaning you get a lot of useless packages on the system. Dpkg part you already know.


So, if one were to use Aptitude to uninstall something that was installed with apt, would that still remove dependencies?

divukman 03-13-2006 05:10 PM

Quote:

Originally Posted by RodWC
So, if one were to use Aptitude to uninstall something that was installed with apt, would that still remove dependencies?

No, try deborphan for that. :D

kushalkoolwal 03-13-2006 08:18 PM

Quote:

Originally Posted by David the H.
dpkg handles the basic low-level install/uninstall and configuration routines. Apt sits on top of it to add downloading, dependency handling, and other usability features. Aptitude, Dselect, Synaptic and such are all gui or ncurses frontends for Apt.

I guess I have something more to add to the ongoing confusion.

Accroding to Debian Docs at
http://www.nl.debian.org/doc/manuals...ackage.en.html

Code:

APT uses /var/lib/apt/lists/* for tracking available packages while dpkg uses /var/lib/dpkg/available. If you have installed packages using aptitude or other APT front ends and you want to use dselect to install packages then the first thing you should do is update /var/lib/dpkg/available by selecting [U]pdate from dselect's menu (or by running "dselect update").

So when I install any package from apt-get for e.g.

apt-get install xserver-xorg


I am able to do the following also:

dpkg --purge xserver-xorg
or
dpkg-reconfigure xserver-xorg


How does dpkg become aware of what packages were installed on my system with apt-get if both (APT & DPKG) uses different file for tracking packages.

Next question is:

We know that apt-get, aptitude, synaptic,gsynaptic are all tools related to APT system, but no where it is mentioned(in manuals) that dselect is a part of dpkg or APT, although when I read the man pages for dpkg and dselect, both of them said that is a front-end tool for dpkg and APT system respectively.

So where does deselect stand ??

Also is there any way through apt-get by which we can download the recommended and suggested packages also. Does aptitude downloads recommended and suggested.

Thanks

vharishankar 03-13-2006 11:33 PM

Yes, all this is very confusing. I suggest sticking to one method for those in doubt, since dselect and apt-get/aptitude seem to use different underlying methods...


All times are GMT -5. The time now is 06:29 PM.