Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is this info part of APT cache or does it create a separate file to compare with new cache? Where is it stored then?

share|improve this question
add comment

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.

share|improve this answer
    
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
add comment

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'
share|improve this answer
    
Does APT cache track "New in repository" info? Check the question, please. –  int_ua Feb 21 '13 at 7:14
1  
Yes, 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
1  
I 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 7:50
show 1 more comment

Your Answer

 
discard

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.