dpkg --list | grep [0-9]\-jre-headlessshows, rc  openjdk-7-jre-headless:amd64                         7u79-2.5.6-0ubuntu1.14.04.1                      amd64        OpenJDK Java runtime, using Hotspot JIT (headless)rc  openjdk-7-jre-headless:i386                          7u79-2.5.5-0ubuntu0.14.10.2                      i386         OpenJDK Java runtime, using Hotspot JIT (headless)rc  openjdk-8-jre-headless:amd64                         8u40~b09-1                                       amd64        OpenJDK Java runtime, using Hotspot JIT (headless)ii  openjdk-8-jre-headless:i386                          8u40~b09-1                                       i386         OpenJDK Java runtime, using Hotspot JIT (headless)This clearly says, openjdk-7-jre-headless:i386 is installed in  my ubuntu 14.04 machine.However when i run, apt-get remove openjdk-7-jre-headless:i386, it says,Building dependency tree       Reading state information... DonePackage 'openjdk-7-jre-headless:i386' is not installed, so not removedWhy does dpkg --list and apt-get remove, show contradictory messages for the same package?
dpkg --list not in sync with apt-get
apt;dpkg
dpkg shown right information, the rc flags in its output meaning openjdk-7-jre-headless:i386 was removed but its configuration files wasn't.dpkg -l is actually front end for dpkg-query -l. You can read dpkg-query manual for more details.