where does 'apt-cache depends' collect the dependency information from?

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?


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

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.