Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone provide a script that can fetch package information (name, depends, etc.) from the Packages repository file(s)?

Or can someone tell what the naming convention is for the Packages file?

Let me explain. When we give the command apt-get update it fetches a Packages.gz file from the web which contains each package's information. I need to fetch information for each package from that file. Or I could use a tutorial link instead.

Note: it is not a homework :)

share|improve this question
up vote 5 down vote accepted

apt-cache can be used to query the packages list. To get a full list of all known packages, run apt-cache dump.

Generally, you want to get a list of all available packages, and get more information about a certain package.

  • apt-cache pkgnames - shows all available package names
  • apt-cache show [package] - shows all known information about package [package] (multiple outputs are possible if a package exists in multiple repositorues, like a PPA and the main repos)
  • apt-cache depends [package] - shows the dependencies for package [package]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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