在一Linux服務器上檢查是否安裝了一些包時,遇到老是提示"package compat-libstdc++ is not installed"
[root@DB-Server ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
> compat-libstdc++ \
> elfutils-libelf \
> elfutils-libelf-devel \
> gcc \
> gcc-c++ \
> glibc \
> glibc-common \
> glibc-devel \
> glibc-headers \
> ksh \
> libaio \
> libaio \
> libaio-devel \
> libgcc \
> libstdc++ \
> libstdc++-devel \
> make \
> sysstat
binutils-2.17.50.0.6-14.el5 (x86_64)
package compat-libstdc++ is not installed
elfutils-libelf-0.137-3.el5 (x86_64)
elfutils-libelf-0.137-3.el5 (i386)
elfutils-libelf-devel-0.137-3.el5 (x86_64)
gcc-4.1.2-51.el5 (x86_64)
gcc-c++-4.1.2-51.el5 (x86_64)
glibc-2.5-65 (x86_64)
glibc-2.5-65 (i686)
glibc-common-2.5-65 (x86_64)
glibc-devel-2.5-65 (x86_64)
glibc-devel-2.5-65 (i386)
glibc-headers-2.5-65 (x86_64)
ksh-20100202-1.el5_6.6 (x86_64)
libaio-0.3.106-5 (x86_64)
libaio-0.3.106-5 (i386)
libaio-0.3.106-5 (x86_64)
libaio-0.3.106-5 (i386)
libaio-devel-0.3.106-5 (x86_64)
libaio-devel-0.3.106-5 (i386)
libgcc-4.1.2-51.el5 (x86_64)
libgcc-4.1.2-51.el5 (i386)
libstdc++-4.1.2-51.el5 (x86_64)
libstdc++-4.1.2-51.el5 (i386)
libstdc++-devel-4.1.2-51.el5 (x86_64)
make-3.81-3.el5 (x86_64)
sysstat-7.0.2-11.el5 (x86_64)
[root@DB-Server ~]#
[root@DB-Server ~]# rpm -qa | grep "compat-libstdc"
compat-libstdc++-33-3.2.3-61
compat-libstdc++-33-3.2.3-61
compat-libstdc++-296-2.96-138
[root@DB-Server ~]#
但是使用上面命令發現這個這些包其實是已經安裝了的,那麼為什麼老是提示compat-libstdc++沒有安裝呢?這個是因為使用rpm查詢時,包名不正確所致。它真正的報名為 compat-libstdc++-33 而不是compat-libstdc++ 。如果包名正確,那麼查詢結果就會不一樣,如下所示:
[root@DB-Server ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' compat-libstdc++-33
compat-libstdc++-33-3.2.3-61 (x86_64)
compat-libstdc++-33-3.2.3-61 (i386)
http://xxxxxx/Linuxjc/1146317.html TechArticle