[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting a list of installed packages

On Tue, Dec 27, 2005 at 12:53:46PM -0800, J Merritt wrote:
>    Is there a way to get a list of installed packages in Debian, preferably
>    from the command line and preferably in a text file?
>    Thanks in advance for any suggestions.

  To show all installed packages you can use the "dpkg" command, and
 then filter the list via grep to those that are installed.  (And not
 removed/purged).  To do this run:

skx@itchy:~$ dpkg --list |grep ^ii

  You might find the package name is truncated, so can fix this
 by running:

skx@itchy:~$ COLUMNS=200 dpkg --list |grep ^ii

  Finally if you just want to see the *name* of the package you can
 use awk to print that out alone.  This stops you from seeing the
 one-line package description too:

skx@itchy:~$ COLUMNS=200 dpkg --list |grep ^ii | awk '{print $2}'

  If you wish this list to be in a file just use redirection:

skx@itchy:~$ COLUMNS=200 dpkg --list |grep ^ii | awk '{print $2}' > list.txt

Debian GNU/Linux System Administration

Reply to: