I originally asked something similar here
http://unix.stackexchange.com/q/201869/31347 but did not get the comprehensive answer.
The complete question would be: how to capture everything apt-cache outputs?
Example:
apt-cache policy non_existing_package --- here we need to capture stderr
apt-cache policy apt --- here we need to capture stdout
So is there a generic command that could capture everything and pipe further so that the call like
apt-cache policy ... | grep "something" --- was successful?
--
With best regards, Ivan Kurnosov