3

I want to modify the dependencies of a debian package and I have made changes in its control file. But, the list of apt-cache depends pkg_name still displays the removed dependencies. So, where does the above command fetches the dependency list of a debian package from? Is it not from the control file?

2 Answers 2

2

apt-cache data comes from lists within:

/var/lib/apt/lists

e.g:

grep -i "Package: wget$" -A10 /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_zesty_main_binary-amd64_Packages

However as you know, the deb package's meta-data, contains a list of dependencies too.

So if you want to see what a deb file thinks of its own dependecies run:

dpkg -I package-name.deb | grep -i depends
2
  • despite changing the dependency list in the file from the directory you have mentioned still displays the removed dependencies when 'apt-cache depends' is run. Any ideas?
    – sam95
    May 9, 2017 at 6:53
  • Not much, there is a binary file /var/cache/apt/pkgcache.bin which apt create it with these lists for doing faster queries, try removing that, see what happens.
    – Ravexina
    May 9, 2017 at 6:56
2

I am not getting a clear picture what you are trying to do however I am trying to answer your question
Where does 'apt-cache depends' collect the dependency information from?

When you run apt-get update, it fetches all the packages metadata from repositories mentioned in /etc/apt/sources.list file and /etc/apt/sources.list.d directory.

These metadata are stored in two files

/var/cache/apt/pkgcache.bin
and
var/cache/apt/srcpkgcache.bin

apt-cache command uses these two cache files to display the user's queries.


How these files are Updated?

srcpkgcache.bin includes all informations you get from the internet by deb and deb-src lines These information are changed only on apt-get update.

Where as pkgcache.bin caches the information in srcpkgcache.bin and the informations extracted from the apt and dpkg status files.
These information change on every changes done by apt or dpkg.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .