rpm +在rpm安装后无法找到rpm

时间:2011-04-12 18:10:45

标签: linux rpm

请告知为什么我找不到我安装的rpm。 我试着通过rpm -qa检查grep test(参见安装rpm的例子:) 但似乎rpm没有安装原因?

构建RPM:

 [root@linux /usr/src/redhat/SOURCES]#  rpm -ba   /usr/src/redhat/SPECS/my_spec.spec
 Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/test.sh
 Wrote: /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm

安装rpm:

   [root@linux /usr/src/redhat/RPMS/i386]# rpm -Uvh  /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm 
   1:test.sh                ########################################### [100%]

   [root@linux /usr/src/redhat/RPMS/i386]# rpm -qa | grep test

   no results ?

spec文件:

  Summary: An example tool. To show a simple rpm build of the tool.
  Name: test.sh
  Version: 6.2
  Release: 2
  Source:/root/test.sh
  Group: Development/Debuggers
  BuildRoot:/var/tmp/test.sh
  License: OtherLicense
  %description

4 个答案:

答案 0 :(得分:4)

您安装了源rpm而不是实际的rpm:

rpm -Uvh /root/rpmbuild/RPMS/test.sh-6.2-2.rpm

答案 1 :(得分:2)

rpmbuild输出两个文件:

  1. 源RPM(SRPM),位于SRPMS /
  2. 二进制RPM,位于RPMS //
  3. 如Wes所说,您已经安装了SRPM。您需要安装RPM,它位于您的RPMS / i386 / subdir中。不要重命名SRPM,您需要查找位于RPM文件夹中的文件并安装它:

    rpm -Uvh RPMS/i386s/test.sh-6.2-2.i386.rpm
    

答案 2 :(得分:0)

当您安装src.rpm时,它最终会在

  ~/rpmbuild/SPEC
  ~/rpmbuild/SOURCES

如果你想重建并获得二进制rpm,你应该:

  rpmbuild -ba test.sh-6.2-2.src.rpm

甚至更好

  mock test.sh-6.2-2.src.rpm

答案 3 :(得分:0)

尝试:

rpm -q test.sh-6.2-2

rpm -q test.sh-6.2-2.src