What is the difference between dpkg and aptitude/apt-get?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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
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.
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, 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
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?
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.
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.
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.