Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: "Problem" when installing a RPM

  1. #1

    Default "Problem" when installing a RPM

    Hi,

    I'm trying to make my own rpm and I did so. It has succeeded to build the rpm and at the same time has installed it (rpmbuild -ba).
    But when I build only the source and the binary and I try to install it with rpm -i *.rpm, it says it has installed the rpm, but it is nowhere and I can't launch it.

    When I try to "reinstall" it, it prompt me that the package is already installed...

    Did someone have an answer ?

    Thanks

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: "Problem" when installing a RPM

    On 2013-10-24 19:46, kamikaz92 wrote:
    >
    > Hi,
    >
    > I'm trying to make my own rpm and I did so. It has succeeded to build
    > the rpm and at the same time has installed it (rpmbuild -ba).
    > But when I build only the source and the binary and I try to install it
    > with rpm -i *.rpm, it says it has installed the rpm, but it is nowhere
    > and I can't launch it.


    What can't you launch, the install or your program?

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  3. #3

    Default Re: "Problem" when installing a RPM

    I can't launch the program, it says that it doesn't exist.

    When I enter
    Code:
    $ rpm -ivh test-1.0-1.x86_64.rpm
    for example, "test" is installed but I can't run it :
    Code:
    $ test(-1.0)
    Command not found[...]
    So, why ?

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    19,878
    Blog Entries
    1

    Default Re: "Problem" when installing a RPM

    Quote Originally Posted by kamikaz92 View Post
    I can't launch the program, it says that it doesn't exist.

    When I enter
    Code:
    $ rpm -ivh test-1.0-1.x86_64.rpm
    for example, "test" is installed but I can't run it :
    Code:
    $ test(-1.0)
    Command not found[...]
    So, why ?
    Is the file really named 'test(-1.0)'? (I doubt it)

    You don't tell us the files contained in test-1.0-1.x86_64.rpm

    Code:
    rpm -ql test-1.0
    Maybe the executable is not in the path.
    Last edited by deano_ferrari; 24-Oct-2013 at 13:21.

  5. #5

    Default Re: "Problem" when installing a RPM

    The rpm is called "test-1.0-1.x86_64.rpm" :

    Code:
    $ rpm -ivh /usr/src/packages/RPMS/x86_64/test-1.0-1.x86_64.rpm
    Preparating...                       ################################# [100%]
    Updating / installing...
       1:test-1.0-1                       ################################# [100%]
    $ test-1.0
    bash: /usr/local/bin/test-1.0: no such file or directory

  6. #6

    Default Re: "Problem" when installing a RPM

    Try getting debugging output when you do that:

    Code:
    --------------------
    set -x
    test-1.0
    --------------------

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  7. #7

    Default Re: "Problem" when installing a RPM

    The output :
    Code:
    $ test-1.0
    + test-1.0
    bash: /usr/local/bin/test-1.0: no such file or directory
    ++ ppwd
    ++ true
    $
    Didn't say anything helpful

    Here is my spec file :
    Code:
    #
    # spec file for package 
    #
    # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
    #
    # [...]
    
    # Please submit bugfixes or comments via http://bugs.opensuse.org/
    #
    
    # norootforbuild
    
    Name:          test
    Version:        1.0
    Release:       1
    License:        MIT-like
    Summary:     Test
    Url:               -
    Group:          System Environment/Libraries
    Source:         test-1.0.tar.bz2
    BuildRoot:     %{_tmppath}/%{name}-%{version}-build
    
    %description
    Test
    
    %prep
    %setup -q
    
    %build
    make
    
    %install
    %make_install
    
    %clean
    rm -rf $RPM_BUILD_ROOT
    
    %files
    %defattr(755,root,root)
    Have been on this for weeks

  8. #8

    Default Re: "Problem" when installing a RPM

    According to your spec file, the resulting rpm is empty, i.e. it contains _no_ files. (run "rpm -ql test" to verify this as already was suggested)

    You have to add the files that should be included in the rpm to the %files section.

  9. #9

    Default Re: "Problem" when installing a RPM

    Good point, I thought it already had included the executable file in the rpm when building it.

    Now, how can I include this file ? It is in my "/usr/src/packages/SOURCES/test-1.0" directory and the %file section look in the "/usr/src/packages/BUILDROOT" directory. Does that mean I have to copy my rpm in the buildroot ?

    Thank you

  10. #10

    Default Re: "Problem" when installing a RPM

    Quote Originally Posted by kamikaz92 View Post
    Good point, I thought it already had included the executable file in the rpm when building it.

    Now, how can I include this file ? It is in my "/usr/src/packages/SOURCES/test-1.0" directory and the %file section look in the "/usr/src/packages/BUILDROOT" directory. Does that mean I have to copy my rpm in the buildroot ?
    Well, apparently you never created an RPM before, have you?

    Here's an overview: Building RPMs
    For this case, have a look at "6.8 Files" especially.

    So in short: That "%make_install" in the %install section copies your files to buildroot (it "installs" them during the build). For the files to actually be in the RPM (and be copied by RPM into the system when you install it), you have to list those files in the %files section, as I already said.
    F.e. let's say, compiling your tarball results in a program /usr/bin/test (during the build with rpmbuild it _will not_ be copied to /usr/bin/ but %buildroot/usr/bin/ instead, but just forget about that detail for now). For /usr/bin/test to be in the RPM, you would have a %files section like this:
    Code:
    %files
    %defattr(755,root,root)
    /usr/bin/test
    There are rpm macros you can use though, so this could f.e. also be:
    Code:
    %files
    %defattr(755,root,root)
    %{_prefix}/bin/test
    or
    Code:
    %files
    %defattr(755,root,root)
    %{_bindir}/test
    You have to do this for all other files that are installed by "make install" as well. In fact if you build your RPM on OBS it will fail if it creates any files not listed in %files (rpmbuild should give a warning by default). If you specify a directory there, all the files in that directory get included as well.

    HTH. Maybe also have a look at existing spec files.

    Or just use "checkinstall" to create an RPM from the source tarball, you don't need to write a spec file then.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •