When you run apt-get update, it keeps a list of everything in /var/lib/apt/lists/ inside the files that end with “_Packages”. So you can parse the files for lines that begin with the word “Package:” and “Version:” which will list the package/program name and its version. Then you can combine the two lines Package and Version with “paste” command, so that the package and its version are on the same line (which make it so its 1 line per package).

So after running apt-get update you get this output:

Then you have sed to make it easier on the eyes, and sort to sort by package name:

Now If you want good output about all of your repos check this out:

Output will be like this:


Leave a Reply

Your email address will not be published. Required fields are marked *