LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-29-2010, 12:36 PM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Thumbs up 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.
 
Old 06-29-2010, 01:10 PM   #2
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
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.

Last edited by zirias; 06-29-2010 at 01:13 PM. Reason: more info
 
Old 06-29-2010, 01:19 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Original Poster
Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
As I mentioned, all the Google results were about the "user view", but i want to know how it actually works.
 
Old 06-29-2010, 01:19 PM   #4
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Testing/Unstable Amd64
Posts: 1,476

Rep: Reputation: Disabled
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?.
 
Old 06-29-2010, 01:26 PM   #5
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
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)
 
Old 06-29-2010, 01:26 PM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Original Poster
Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Where does dpkg* end and apt* start?

Last edited by MTK358; 06-29-2010 at 01:30 PM.
 
Old 06-29-2010, 01:30 PM   #7
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
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.
 
Old 06-29-2010, 01:31 PM   #8
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Testing/Unstable Amd64
Posts: 1,476

Rep: Reputation: Disabled
Generally i install packages from the Debian repositories with aptitude.
You use dpkg to install individual .deb's downloaded from the web,for example.
 
Old 06-29-2010, 01:44 PM   #9
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Original Poster
Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
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?
 
Old 06-29-2010, 01:51 PM   #10
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Testing/Unstable Amd64
Posts: 1,476

Rep: Reputation: Disabled
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.
 
Old 06-29-2010, 01:53 PM   #11
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
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).
 
Old 06-29-2010, 02:00 PM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
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
..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Learn Linux, 101: Debian package management LXer Syndicated Linux News 0 05-12-2010 05:20 AM
Debian package management - how are debconf and dpkg-deb related? austinium Debian 5 03-08-2010 05:25 AM
LXer: Three scripts for package management on Debian and Ubuntu systems LXer Syndicated Linux News 1 10-29-2008 08:59 PM
LXer: Debian/Ubuntu Package management Using dpkg LXer Syndicated Linux News 0 04-19-2007 09:47 PM
Debian package management markus1982 Linux - Distributions 12 02-16-2003 06:44 AM


All times are GMT -5. The time now is 03:22 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration