<div dir="ltr"><br><div class="gmail_quote"><br><div dir="ltr">
<p>I am curious to know about the apt code so that I can contribute to this project and learn from it.</p>
<p>I have a question on "apt-get update" implementation. I did go
through the code for a couple of days but couldn't get full clarity so
need your help.</p>
<p>/var/lib/apt/lists - This contains two kinds of files. One set of
files (* _Packages) that has the full package information with the short
description. Another set of files (* _i18n_Translation-en) has just the
full description for all the packages.</p>
<p>/var/cache/apt/ - This directory has two different caches
(pkgcache.bin, srcpkgcache.bin). These are constructed from the
information stored in the /var/lib/apt/lists directory.</p>
<p><b>Here are my questions,</b></p>
<ol><li>How does apt-cache create and updates the local package cache? Is it
periodic or manual? As far as my investigation, it is manual (apt-get
update).</li></ol>
<p>fyi, I am using Linux 4.4.0-18362-Microsoft. "apt-config dump" command output doesn't show "APT::Cache::Generate".</p>
<ol start="2"><li>When we run "apt-get update", does it download all the packages
information that will be stored in /var/lib/apt/lists/* _Packages file?
Is there a advanced logic, where client sends current state information
(like all packageNames and their versions)? This is a puzzle as the code
is very cryptic to understand.</li></ol>
<p>I modified
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_xenial-security_restricted_binary-amd64_Packages
(changed the version for one of the package) and ran "apt-get update"
but it didn't revert my change. Why?</p>
<p>This confirms, apt-get is looking at someother file to make the
decision to update the /var/lib/apt/lists/* _Packages file. When does
the /var/lib/apt/lists/* _Packages file gets updated?</p>
<p>Can you explain whether it's expected behavior or not.</p>
<p>I did notice that the /var/cache/apt/pkgcache.bin (and srcpkgcache.bin) are updated everytime I run "apt-get update".</p>
<ol start="3"><li>
<p>What goes into pkgcache.bin and srcpkgcache.bin? I couldn't find any useful information in the internet.</p>
</li><li>
<p>Why do we store the package full description in a different file? Is
it because we want make cache faster that has only the short package
description?</p>
</li></ol>
</div>
</div></div>