Example: Determining the installed version of gcc
On SLES and RHEL
To see whether gcc is
installed on SLES or RHEL, query for the gcc package
as follows:
rpm -q gcc
If gcc version 4.8-5.3 is
installed, you will get a result similar to the following output: gcc-4.8-5.3
On Ubuntu
To see whether gcc is installed on Ubuntu,
query for the gcc package as follows:
dpkg -l gcc
If gcc version 4.8.2-1ubuntu4 is
installed, you will get a result similar to the following output: Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==========-=====================-================-===================
ii gcc 4:4.8.2-1ubuntu4 ppc64el GNU C compiler