Artificial intelligent assistant

How to check if aptitude did something? I've a CI build process during which I install a debian package from my local reprepro. I have a `Makefile` which does call aptitude to install the package from its own repository like this sudo aptitude -y install foobar >> aptitude.log 2>&1 Now it could happen that aptitude has conflicts, which can't be resolved or the repository doesn't offer a new version for the package "foobar". In both cases aptitude wouldn't install anything. But echo $? after the aptitude call in the `Makefile` always returns `0`. What way do you propose to check if aptitude actually did install anything? Grepping for the last line of the aptitude output is the only thing I can think of if the exit codes are always `0`.

Try with `dpkg-query`, which print information about installed package

Exemple:


dpkg-query -W -f='${Status} ${Version}\
' foobar


Will result


No packages found matching foobar.


Run `dpkg-query --help` for more information

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ba0066f319e373049f360a32eadf8f59