Is this info part of APT cache or does it create a separate file to compare with new cache? Where is it stored then?
2 Answers
If I'm not mistaken the files you are looking for are:
- /var/cache/apt/pkgcache.bin
- /var/cache/apt/srcpkgcache.bin
This is a local package database for binary and source packages respectively. It is updated every time you run apt-get update
or programs like Synaptic do that somehow.

- 809
-
yes, but it is the APT cache, is that info stored there? In case it is how can we extract it? – int_ua Feb 14 '13 at 14:16
-
2@int_ua, didn't understand you from the very beginning. Yes, sure - /var/cache/* is part of APT cache :) I doubt that you can find the answer to your question even in documentation. To be sure whether Synaptic uses this file or not you'll probably have to have a look in the code. People out there on the Internet say it does (well, I also don't see any reason why it wouldn't - however this is just an assumption). As of how to parse it. It is a binary file, so also only programmatically. I'd have a look at some APT libraries. – Pavel A Feb 14 '13 at 14:57
To extract the information from the apt cache, you use apt-cache
or other Debian/Ubuntu tools such as aptitude. For instructions and examples, see man apt-cache
or the Debian Package Management manuals
For example:
apt-cache show software-center
will list the complete package information.
Synaptic is essentially a GUI wrapper around apt, so its apt that is keeping track of the repository and package information and Synaptic is querying it.
apt-cache wrapped in bash scripts is probably the easiest way to do something similar on your own. Synaptic uses libapt-pkg* via C++, but there are also libraries for Perl and Python.
Finding new packages in aptitude
aptitude search '~N'

- 15,246
-
Does APT cache track "New in repository" info? Check the question, please. – int_ua Feb 21 '13 at 07:14
-
1Yes, it's all in the Debian manuals. You can use apt-cache or aptitude to find and track new packages. apt uses an xapian database that the other tools search. – chaskes Feb 21 '13 at 13:12
-
the bounty ended, but if you'll add how to get it with
apt-cache
or any other precise answer I'll award you 100 points. – int_ua Feb 21 '13 at 13:51 -
Ok, I'm still looking into some details and may edit the answer some more, but I added the specific command for aptitude. If you still need something else specific, please let me know. – chaskes Feb 22 '13 at 16:13
-
But the questions is how does aptitude keep track of these packages. I assume it uses the same method as Synaptic. But I can't find it myself yet. – int_ua Feb 23 '13 at 07:22
-
1I know, that's the part I'm still working on. I'll add more as I come up with it. – chaskes Feb 23 '13 at 07:50