0

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 1

3

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
2
  • Thanks. So does apt-get update update the apt cache? If not where does apt-cache get its information from? Mar 17, 2012 at 2:12
  • 1
    Let 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.