I am curious to know about the apt code so that I can contribute to this
project and learn from it.

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.

/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.

/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.

*Here are my questions,*

   1. 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).

fyi, I am using Linux 4.4.0-18362-Microsoft. "apt-config dump" command
output doesn't show "APT::Cache::Generate".

   1. 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.

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?

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?

Can you explain whether it's expected behavior or not.

I did notice that the /var/cache/apt/pkgcache.bin (and srcpkgcache.bin) are
updated everytime I run "apt-get update".

   1.

   What goes into pkgcache.bin and srcpkgcache.bin? I couldn't find any
   useful information in the internet.
   2.

   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?
-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to