yum For RHEL/Fedora/Centos/Scientific Linux
Provides the command
list to display information about installed and upgradeable (and older) packages.
yum --showduplicates list <package>
zypper For SuSE Linux
Can return a detailed list of available and installed packages or patches.
zypper search -s <package>
--exact-match can help, if there are multiple packages.
As a side-note, here is a comparison of package-management commands.
You can use
rpm -qi <package name> to have all information of installed package.
You can use below commands as well:
yum info <package name> yum list <package name> yum --showduplicates list <package name>
The other answers addresses how to get information about the installed packages on the system. To add to that, it is also possible to query the yum repository about available not yet installed packages in addition with the
pkcon search command from PackageKit, e.g.
$ pkcon search name xz Searching by name [=========================] Starting [=========================] Querying [=========================] Available pxz-4.999.9-2.beta.20100608git.fc15.i686 Parallel LZMA compressor using XZ Installed xz-5.0.3-1.fc15.i686 LZMA compression utilities Available xz-compat-libs-5.0.1-2.fc15.i686 Compatibility libraries for decoding LZMA compression Available xz-compat-libs-5.0.3-1.fc15.i686 Compatibility libraries for decoding LZMA compression Installed xz-debuginfo-5.0.3-1.fc15.i686 Debug information for package xz Installed xz-devel-5.0.3-1.fc15.i686 Devel libraries & headers for liblzma Installed xz-libs-5.0.3-1.fc15.i686 Libraries for decoding LZMA compression Installed xz-lzma-compat-5.0.3-1.fc15.i686 Older LZMA format compatibility binaries Installed xzgv-0.9.1-3.fc15.i686 Picture viewer $
I assume PackageKit is written generic so that it works with apt repositories as well, although I have only experience from using it on my Fedora systems.