Re: Re: mashup "apt-cache search <SearchTerm>"
> 3a) I'd like to get an output list including all the packages from
> step 1 above,
> 3b) Showing the package name, & its installed status (ii, un, etc)
> like from step 2.
>
> Note: One way might be to:
> 1) Do the apt-cache search <packagename>
Note that that searches the package descriptions. To search for
package names, add the -n option.
> 2) For each line
> 2a) Pull out the package name
> 2b) Write an apt-cache search for that name only to a temp file
> 3) Do the dpkg -l 's from the file
Temp file is unnecessary.
> 3b) & remove from the output all the dpkg heading info, leaving only
> the package status lines.
apt-cache search parted |awk '{print $1}' |xargs dpkg -l 2>&1 | sed '1,/^+++/d'
un parted <none> (no description available)
No packages found matching libparted1.8-10.
No packages found matching gparted.
No packages found matching fatresize.
No packages found matching gnu-fdisk.
No packages found matching libparted1.8-dbg.
No packages found matching libparted1.8-dev.
No packages found matching libparted1.8-i18n.
No packages found matching parted-doc.
No packages found matching qtparted.
Note that dpkg is not aware of all the packages returned by apt-cache
search, and prints a message on standard error for each one. Hence the
use of 2>&1 above.
--
Cheers,
Clive
Reply to: