If I run the command apt-cache showpkg {packagename}
, does it only show the details of the package of it is installed or does it not matter? If I run the command apt-get update
, does this update apt-get's cache and hence showing me all the package details?
1 Answer
apt-get update downloads the package lists and metadata to your local box. With apt-cache you look up stuff in the local data (local "apt cache").
See more information at
man apt-cache
-
Thanks. So does
apt-get update
update the apt cache? If not where doesapt-cache
get its information from? Mar 17, 2012 at 2:12 -
1Let me help you finding that information out by yourself. Run strace -f -e trace=open apt-cache search test |less and see the output. You will find lines such as open("/var/lib/apt/lists/ftp.hosteurope.de_mirror_archive.ubuntu.com_dists_hardy-security_universe_binary-amd64_Packages", O_RDONLY) = 8 which leads you to the folder /var/lib/apt/lists. This is only one of them, usually /var/lib/apt and /var/lib/dpkg contain the locally stored information. Mar 17, 2012 at 9:44