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

Re: Listing only the package names with dpkg?



Preben Randhol <randhol@pvv.org> wrote:
>I'm trying to list out all the packages I have installed on my system.
>I can do a dpkg -l, but I only want the package names not the rest, as
>I'm going to use the package names.

  dpkg --get-selections | cut -f1

... or, if you need the version numbers too:

  dpkg -l | grep ^ii | sed 's/^[^ ]* *\([^ ]*\) *\([^ ]*\).*/\1_\2/'

'man 7 regex' for documentation on regular expressions.

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: