Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

How does the Software Center keep track of installed packages? In which files/database?

share|improve this question
up vote 4 down vote accepted

dpkg (Software-Center is a graphical front-end of dpkg) keeps track of the installed packages in /var/lib/dpkg/status.

share|improve this answer
This seems like the right answer - Software Center gets its information about which packages are installed from dpkg's database. – loevborg Jan 19 '11 at 9:51
Sounds right but when you want to install a package, you also need to find the associated .deb file to know which files to remove right? Where are those .deb files cached? – Olivier Lalonde Jan 19 '11 at 14:16
That didn't make sense. You remove files when you UNinstall a package. That information is in /var/lib/dpkg/info/. – psusi Jan 19 '11 at 14:46

From what I can tell, it uses xapian databases located at /var/cache/software-center/xapian.

From a quick read over the code here, specifically the 'rebuild_database' function, it looks like the above are built/re-built from the apt cache (using the Python-apt wrapper, which in turn uses libapt-pkg).

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.