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

Re: script to list installed packages

* Dave Carrigan <dave@rudedog.org> [040130 00:46]:
> On Thu, Jan 29, 2004 at 07:58:36PM +0900, Nick Hastings wrote:
> > Careful, dpkg --get-selections doesn't always list only installed
> > packages
> > Try:
> > 
> > dpkg --get-selections | grep -w install | cut -f1
> To be pedantic, this will fail if a package has the string "install" in
> its name and is in a non-installed state. 

No I don't think so, note the "-w" flag. It will only match if the
package name _is_ "install".

> Also, this will miss held packages.

My apologies you are correct here.

> Better would be
>   dpkg --get-selections | awk '$2 ~ "install|hold" {print $1}'

Oops, now you will match with "uninstall"... or perhaps this status
doesn't exist anymore? Anyone know all possible statuses that can be
reported by dpkg --get-selections? 


Debian testing/unstable
Linux twofish 2.6.1-looxt93c1 i686 GNU/Linux

Attachment: signature.asc
Description: Digital signature

Reply to: