Installing lists of packages from aptitude
Dotan Cohen
dotancohen at gmail.com
Sun Dec 27 22:14:03 UTC 2009
> # on one line:
> aptitude search "~n^kde.*-dbg$" | grep -v "^i" | cut -c4-36 | xargs echo aptitude install
>
> Short explanation:
> let aptitude search only package names (~n) which start with kde (^kde), then
> any or no chars (.*), then end with -dbg (-dbg$); pipe output to grep which searches
> for lines not beginning with i (grep -v "^i"); pipe output to cut wich
> only prints from char #4 to #36; pipe that output to xargs which
> collects the output and appends it to "echo aptitude install"
>
> Remove "echo" to really install the packages.
>
> Yes, my search is not the same as your search. You searched for
> packages with "dbg" anywhere in it and with "kde" anywhere in it. My
> search is a bit more precise to avoid matches like kxsldbg-kde3.
>
> That's how i would do it on the quick. I'm sure there are many better
> ways to achive the same goal.
>
I see, thanks. I thought that there may be a less brute method of
doing this. I suppose that is what the GUI package managers are for.
Thanks! I especially appreciate the explanation of the different
parts. That is quite how I learn!
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
More information about the ubuntu-users
mailing list