简体   繁体   中英

RPM + cant find rpm after rpm install

please advice why I cant find the rpm that I installed. I am try to check by rpm -qa | grep test ( see the example in install the rpm: ) but seems that rpm isnt installed why?

build the 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

install the 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 ?

the spec file:

  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

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

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

rpmbuild outputs two files:

  1. A source RPM (SRPM), located in SRPMS/
  2. A binary RPM, located in RPMS//

As Wes noted, you've installed the SRPM. You need to install the RPM, which is located in your RPMS/i386/ subdir. Don't rename the SRPM, you need to look for the file located in the RPM folder and install it:

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

When you install src.rpm it ends up in

  ~/rpmbuild/SPEC
  ~/rpmbuild/SOURCES

If you want to rebuild and get binary rpm you should:

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

or even better

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

Try:

rpm -q test.sh-6.2-2

or

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM