This question explains how to find out if a given Debian package has been installed, but it does not take into account "synonyms" when installing via
For instance, if I try
apt-get install libncurses-dev, apt-get replies:
Note, selecting 'libncurses5-dev' instead of 'libncurses-dev'
And then it installs that package (
libncurses5-dev), which is fine by me.
But what if I want to make a script to detect if the package has already been installed?
dpkg -s libncurses-dev replies that the package is not installed, which is indeed correct, since it's
libncurses5-dev that was installed. But I'd like my script to detect that, in this case, it no longer needs to install
I could not find an option in
apt-get to check if the given package or one of its providers has already been installed, such that my script would work when checking for
libncurses-dev as well as for