Get all available packages on Ubuntu (or any distro that uses apt)

sudo apt-cache dumpavail | grep Package | cut -d ' ' -f 2 > available.packages

By: mered
2013-05-18 20:42:22

These Might Interest You

  • I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name. The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well. Show Sample Output

    dpkg --list '*linux*' | grep '^ii'
    piyo · 2009-02-13 17:05:37 1
  • Especially useful for latex packages, which are listed in the description of their Ubuntu package E.g. say I want to find the Ubuntu package containing latex package aeguill: aptitude search ~daeguill p texlive-lang-french - TeX Live: French

    aptitude search ~d<string>
    junkieDolphin · 2011-08-02 05:19:13 0
  • completely remove those packages that leave files in debian / ubuntu marked with rc and not removed completely with traditional tools

    dpkg -l | grep ^rc | awk '{ print $2}' | xargs apt-get -y remove --purge
    Richzendy · 2013-02-15 01:34:37 0
  • Works on Ubuntu Show Sample Output

    lsb_release -a
    maedox · 2010-05-26 10:42:52 0

What Others Think

FYI, I got a little bit of garbage in the list until changing 'grep Package' to 'grep Package:'
Vilemirth · 248 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: