Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a guide on one of Linux Package manager architectures. For example apt-get (dpkg), or yum (rpm). I want to know how they manage the package list, file list, package versions and so on. I wonder if anyone could point me to some resource.

share|improve this question
I asked this question at Stackoverflow, but they closed the thread and redirected me to here. – Ako Mar 1 '11 at 6:01
@Ako I'm kinda thinking this might be too broad. I'm not even sure what you mean by "how they manage". Being knowledgeable about how pacman determines differences between version numbers, I know that you could get a really complicated answer just asking that (a full page of text at least). I'd personally prefer it if you split this question up and ask more specifically what you want on each package manager, and were more specific about what exactly you want to know. – xenoterracide Mar 1 '11 at 10:08
@xenoterracide I am not looking for the architecture of all of them. If I could understand one, that would be enough. Thanks. – Ako Mar 1 '11 at 15:38
@ako I still thinks this question is vague. I'm not sure what you want in an answer. You're almost asking how a package manager works, which is not all that different from asking how a database works. How do you think that would fly on another site? I still have no idea what you're asking when you say "how they manage the package list". – xenoterracide Mar 1 '11 at 15:53
@xenoterracide Thanks again for your comment. Well what exactly I want to know is the complete architecture of one of the package managers. I know it is a big big topic, but I can put a lot of time on it. I want to know as much detail as possible about them, like keeping list of installed packages, updates, location of packages, installed files, and any other detail. I would be very glad if anyone could point me to a starting point. – Ako Mar 1 '11 at 16:26

Well yum is rpm based - http://en.wikipedia.org/wiki/RPM_Package_Manager

And apt is (typically) deb based - http://en.wikipedia.org/wiki/Deb_%28file_format%29

There are links from both of those pages that explain more

share|improve this answer
That in no way answers what Ako was asking. What he was interested was a set of UML diagrams or ADL or anything that describe how the package managers are laid out, they Physical view, logical view .... – chutsu Mar 16 '12 at 10:10
I fail to see anything about UML or ADL in the question? – jamespo May 9 '12 at 18:45
"I am looking for a guide on one of Linux Package manager architectures", I'm not sure how else you would represent the architecture other than using UML or ADLs... – chutsu May 12 '12 at 15:33
Well, those diagrams don't exist, so the only option is to look at the package format & manager documentation & source code. – jamespo May 16 '12 at 9:57

Yum is RPM based and is completely written in Python.

Yum or RPM maintains a database (Berkley DB) usually in "/var/lib/rpm".

The database path is "/var/lib/rpm/Packages".

See below:

[root@ec092 rpm]# pwd


[root@ec092 rpm]# file Packages

Packages: Berkeley DB (Hash, version 8, native byte-order)

when you use the commands like rpm -qa it queries the Packages DB and it maintains all the attributes like package list, file list, package versions and so on.

Ubuntu's apt-get is written in C++ and is somewhat complex.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.