LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How Debian package management works (http://www.linuxquestions.org/questions/linux-general-1/how-debian-package-management-works-817014/)

MTK358 06-29-2010 01:36 PM

How Debian package management works
 
How does package management in Debian work?

What are all these commands like apt-get, apt-cache, dpkg, dpkg-deb, dpkg-query, etc? What are their roles?

When I do a Google search all I get are tutorials for newbies on how to install software in Ubuntu.

zirias 06-29-2010 02:10 PM

If you are just interested in the user view on the subject, i found the "APT howto" one of the best sources of information. Unfortunately, it is obsoleted now (I assume mostly because it does not cover the extended capabilities introduced by aptitude like automatic removal of dependencies) -- but i did not find a worthy successor so far, so I think it's still worth reading and maybe have a look at the aptitude manpage :)

just wanted to add this: don't use apt-get, use aptitude instead. the command line interface is NEARLY compatible, so you can use commands from the APT howto in most situations by just replacing apt-get with aptitude. The reason for this is (AFAIK) only by using aptitude, packages installed as dependencies are properly marked as such, so the complete removal will work.

MTK358 06-29-2010 02:19 PM

As I mentioned, all the Google results were about the "user view", but i want to know how it actually works.

the trooper 06-29-2010 02:19 PM

Quote:

How does package management in Debian work?
You'll need to be more specific.

Quote:

What are all these commands like apt-get, apt-cache, dpkg, dpkg-deb, dpkg-query, etc? What are their roles?
Here's a good place to start:

http://www.uk.debian.org/doc/manuals...e/ch02.en.html

Quote:

When I do a Google search all I get are tutorials for newbies on how to install software in Ubuntu
Did you try Debian's site?.

zirias 06-29-2010 02:26 PM

As I said, try the (outdated) APT howto .. most of it's contents are still valid (like pinning etc.)

For a rough overview: the dpkg-* tools (including dpkg itself) deal directly with packages: building, creating, installing, uninstalling, unpacking etc of single packages. The apt* tools deal with package repositories, downloading, automatic dependency resolution and so on. As a user, most of the time you will use aptitude (or maybe a graphical frontend like synaptic)

MTK358 06-29-2010 02:26 PM

Where does dpkg* end and apt* start?

zirias 06-29-2010 02:30 PM

apt* calls dpkg* for the actual unpacking and installing of a package. So, if you downloaded a single package somewhere and you want to install it by hand, you will use "dpkg -i" -- but you won't get automatic dependency resolution, if something is missing, it simply won't install.

normally, you will use apt-tools like aptitude that lookup packages in repositories (configured in /etc/apt/sources.list), download them including all required dependencies and install them automatically.

the trooper 06-29-2010 02:31 PM

Generally i install packages from the Debian repositories with aptitude.
You use dpkg to install individual .deb's downloaded from the web,for example.

MTK358 06-29-2010 02:44 PM

Mostly what I'm wondering:

What parts of dependency resolution are handled by dpkg* and what part by apt*?

And are packages somehow "marked" as non-explicitly installed, like in Arch?

the trooper 06-29-2010 02:51 PM

Quote:

What parts of dependency resolution are handled by dpkg* and what part by apt*?
Dependency resolution is handled by apt/aptitude.

Quote:

And are packages somehow "marked" as non-explicitly installed, like in Arch?
Do you mean installed by via apt or a package manually downloaded and installed with dpkg?.
Is this the sort of thing you mean?:

Code:

ade@Pc1:~$ aptitude show vlc
Package: vlc
State: installed
Automatically installed: no
Version: 1.0.6-1
Priority: optional
Section: video

This isn't the full output by the way.

zirias 06-29-2010 02:53 PM

I think i already wrote that? They are marked IFF (if and only if) you install them using aptitude. Such a marked package is removed by aptitude when the last package depending on it is removed.

dpkg* does NOT do any dependency resolution, only dependency checking. If dependencies are not met, dpkg will refuse to install. The resolution of dependencies is done by APT (nowadays: aptitude).

knudfl 06-29-2010 03:00 PM

A few links about ' Debian dependency ' :

http://en.wikipedia.org/wiki/Advanced_Packaging_Tool

http://www.debian.org/doc/FAQ/ch-pkg_basics.html

http://www.debian.org/doc/manuals/re...e/ch02.en.html
> http://www.debian.org/doc/manuals/re...e_dependencies
> http://www.debian.org/doc/manuals/re...on_of_aptitude
..


All times are GMT -5. The time now is 07:47 AM.