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

Thread: Problem Installing from tar file.

  1. #1

    Default Problem Installing from tar file.

    I am running 64 bit openSUSE13.1 with KDE desktop and trying to install Netdiscover. I have downloaded the tar file, extracted it and made sure all the libraries are in place. When I run ./configure all seems to be OK. Similarly when I run make I do not see any errors. If then run make install I get the following:-

    Code:
    ~/Downloads/Netdiscover/netdiscover-0.3-beta6> make install
    Making install in src
    make[1]: Entering directory `/home/alastair/Downloads/Netdiscover/netdiscover-0.3-beta6/src'
    make[2]: Entering directory `/home/alastair/Downloads/Netdiscover/netdiscover-0.3-beta6/src'
    /bin/sh ../mkinstalldirs /usr/local/sbin
      /bin/sh ../libtool --mode=install /usr/bin/install -c netdiscover /usr/local/sbin/netdiscover
    /usr/bin/install -c netdiscover /usr/local/sbin/netdiscover
    /usr/bin/install: cannot create regular file '/usr/local/sbin/netdiscover': Permission denied
    make[2]: *** [install-sbinPROGRAMS] Error 1
    make[2]: Leaving directory `/home/alastair/Downloads/Netdiscover/netdiscover-0.3-beta6/src'
    make[1]: *** [install-am] Error 2
    make[1]: Leaving directory `/home/alastair/Downloads/Netdiscover/netdiscover-0.3-beta6/src'
    make: *** [install-recursive] Error 1
    alastair@IBMx3400:~/Downloads/Netdiscover/netdiscover-0.3-beta6>
    Ah, I thought. I see there is a permission issue with /usr/local/sbin so I ran 'su -' and then tried 'make install' again. This time all seemed to go according to plan but when I then tried to run sudo netdiscover from my console I received an error message that netdiscover could not be found. The binary 'netdiscover' was however there in /usr/local/sbin/. I tried using "sudo make install" instead of su - and still no joy.
    What is going on and what am I doing wrong?

    Budgie2

  2. #2
    Join Date
    Mar 2011
    Location
    Sauerland
    Posts
    3,798

    Default AW: Problem Installing from tar file.

    sudo has the PATH-Variable of the User:
    Try
    Code:
    echo $PATH
    and you will see, there is no /usr/local/sbin/ in it.

    So start your Programm with the whole Path.

  3. #3

    Default Re: Problem Installing from tar file.

    Quote Originally Posted by Budgie2 View Post
    The binary 'netdiscover' was however there in /usr/local/sbin/. I tried using "sudo make install" instead of su - and still no joy.
    What is going on and what am I doing wrong?
    /usr/local/sbin/ is not in the path.
    So either specify the full path ("sudo /usr/local/sbin/netdiscover"), add /usr/local/sbin to the path, or create a symlink/copy netdiscover to some directory in the path like /usr/sbin/.

    Or, install the program to /usr instead of /usr/local in the first place. How you would do that depends on the particular build system though, probably by adding the --prefix parameter to ./configure. Try to run ./configure --help to find out whether that's supported.

  4. #4

    Default Re: Problem Installing from tar file.

    Quote Originally Posted by Sauerland View Post
    sudo has the PATH-Variable of the User:
    Try
    Code:
    echo $PATH
    and you will see, there is no /usr/local/sbin/ in it.
    /usr/local/sbin is not in root's path either, only /sbin and /usr/sbin.

    But I forgot something in my previous post:
    /usr/sbin will not be in the path of a normal user, so just installing netdiscover there probably won't help for sudo anyway.

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

    Default Re: Problem Installing from tar file.

    On 2014-10-11 14:26, Budgie2 wrote:

    > What is going on and what did I do wrong?


    Trying to run a program as user that is intended to be used as root.

    Same for installation: you need to be root to install any program into
    the system areas.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  6. #6

    Default Re: Problem Installing from tar file.

    Hi Robin, and thanks for the reply but ...

    [QUOTE=robin_listas;2668902]On 2014-10-11 14:26, Budgie2 wrote:

    > What is going on and what did I do wrong?


    Trying to run a program as user that is intended to be used as root.

    I was running it using sudo but still not working.

    Same for installation: you need to be root to install any program into
    the system areas.

    I installed as root also.

    The problem is as noted by others above. /usr/local/sbin is not in path.

    Regards,
    Budgie2

  7. #7

    Default Re: Problem Installing from tar file.

    Quote Originally Posted by wolfi323 View Post
    /usr/local/sbin is not in root's path either, only /sbin and /usr/sbin.

    But I forgot something in my previous post:
    /usr/sbin will not be in the path of a normal user, so just installing netdiscover there probably won't help for sudo anyway.
    Hi wolfi323 and many thanks. I had failed to appreciate that sudo used the path of the local user so that is why it would not run.
    On the other hand /usr/local/sbin is in my root's path for some reason so if I run as su - it works however...

    What the the "correct" way to sort this out? Thanks to you I now know there are several options but what I am not sure of is the conventional solution for binaries installed this way. There is an option in the installer as follows:-

    By default, `make install' will install the package's files in
    `/usr/local/bin', `/usr/local/man', etc. You can specify an
    installation prefix other than `/usr/local' by giving `configure' the
    option `--prefix=PATH'.
    No mention of /usr/local/sbin and when I look in /usr/local/bin there is no sign of netdiscover. I am nervous about specifying a new PATH using --prefix=PATH when the installation does not put the program where stated.

    When you have time I would appreciate further advice but meanwhile you have solved my immediate problem. Many thanks again.

    Budgie2

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,727

    Default Re: Problem Installing from tar file.

    You will be root with the PATH, aliases, etc. that normal;y go with a root login, by using
    Code:
    su -
    And please next time show what you do complete, that is prompt, command, output (the only bit you posted above) and the next prompt. Then we can see and not guess what you do
    Last edited by hcvv; 11-Oct-2014 at 08:25.
    Henk van Velden

  9. #9

    Default Re: Problem Installing from tar file.

    Quote Originally Posted by Budgie2 View Post
    Hi wolfi323 and many thanks. I had failed to appreciate that sudo used the path of the local user so that is why it would not run.
    On the other hand /usr/local/sbin is in my root's path for some reason so if I run as su - it works however...
    Yes, sorry.
    It is in root's path indeed.

    I accidentally ran "su" instead of "su -" to switch to root, when I checked...
    Strange though that /sbin and /usr/bin were there, but well.

    No mention of /usr/local/sbin and when I look in /usr/local/bin there is no sign of netdiscover.
    Well, as netdiscover is intended to be used by root only, it is installed to $prefix/sbin instead of $prefix/bin.
    The help page just doesn't mention every single directory things might get installed to, but all of them will be subdirectories of the specified prefix (unless overridden by other options).
    So add --prefix=/usr and netdiscover, the executable, will be put into /usr/sbin.
    Btw, this is done automatically when you build a package on OBS, so it definitely works. Otherwise your /usr/sbin would be completely empty...

    But if the executable is the only file needed anyway, it might be easier to just copy/move it to /usr/sbin instead of recompiling it.
    I had a look at the one existing package on OBS, and this indeed seems to be the case. Then there's the man page as well, which you could also just copy/move manually to /usr/share/man/man8. Or leave it in /usr/local/share, it should be found there as well.
    Last edited by wolfi323; 11-Oct-2014 at 08:26.

  10. #10

    Default Re: Problem Installing from tar file.

    Hi Wolfi,
    Since I shall seldom be using this and don't want others playing/snooping around will leave as is for now. BTW what is OBS?
    Thanks again for the help.
    Budgie2

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
  •