在一Linux服務(wù)器上檢查是否安裝了一些包時(shí),遇到老是提示"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 ~]#
但是使用上面命令發(fā)現(xiàn)這個(gè)這些包其實(shí)是已經(jīng)安裝了的,,那么為什么老是提示compat-libstdc++沒有安裝呢?這個(gè)是因?yàn)槭褂胷pm查詢時(shí),,包名不正確所致,。它真正的報(bào)名為 compat-libstdc++-33 而不是compat-libstdc++ 。如果包名正確,,那么查詢結(jié)果就會(huì)不一樣,,如下所示: [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) |
|