why does this command not work?

Matthew Carpenter mcarpenter
Fri Jan 12 03:18:27 PST 2007


On Wednesday 10 January 2007 10:13, Roger Oberholtzer wrote:
> On Wed, 2007-01-10 at 04:15 -0700, Myles Green wrote:
> > sudo dpkg --get-selections | grep '[[:space:]]install$='| awk '{print
> > $1}'
>
> run
>
> 	echo "sudo dpkg --get-selections | grep '[[:space:]]install$='| awk
> '{print $1}'"
>
> which is basically your command put in double quotes and echo'd.
>
> Note a difference in what is printed by echo and what your original
> command was?
>
> It's those pesky '\' escapes. Might be more. But that is what I see.

Drop the "=" at the end and all should be well...

The equals sign is there because the author is only interested in the 
installed packages... but the dpkg --get-selections will also return packages 
in other states (like 'deselected', etc...), because a machine is a living 
organism, both installing packages and uninstalling packages over time.

I would personally drop the "awk" statement, since in order to 
use "--set-selections" you'll need the "install" part of the line as well.

Now what *I* would like to know from you experts is this: Once I've restored 
using "dpkg --set-selections", what is the most reliable/robust method of 
actually getting the packages to install?  I've been able to do it, with the 
right combination of "apt-get -f install" and such, but I've found 
that "dselect" -> install seems to work more reliably... why?

Thanks,
MAtt
-- 
Matthew Carpenter
Senior Security Analyst
Intelguardians Network Intelligence, LLC
http://www.intelguardians.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.linux-sxs.org/pipermail/linux-users/attachments/20070112/c7f3953c/attachment.pgp 



More information about the Linux-users mailing list