Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: brethberie on December 03, 2020, 05:12:59 PM



Title: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: brethberie on December 03, 2020, 05:12:59 PM
I've done a clean install of Ubuntu Desktop for Raspberry Pi4 with ARM architecture. I verified the download and am up and running just fine.
source: https://ubuntu.com/raspberry-pi

Now I try to download ARM Linux image of Bitcoin Core. (Trying to get bitcoind/bitcoin-cli up and running for a lightning node)
Verified this download and followed the instructions here: https://bitcoin.org/en/full-node#linux-instructions

Have no trouble extracting the file. Have no trouble running the command to move the file contents to /usr/local/bin (although it does not ask for my password)
Run cd ~/usr/local/bin/ to move into the directory
ls command shows the contents include bitcoind, bitcoin-cli, etc. (all contents of bitcoin-0.20.1/bin/ are in the proper /usr/local/bin directory)

However, when I try to run the bitcoind -daemon command I get an error along the lines of.

/usr/local/bin/bitcoind does not exist even though I can see it when I can navigate to the directory. I have exhausted all possible solutions by google search and have tried alternative install methods (Snap store install doesn't include bitcoind or bitcoin-cli)

I'm hoping this is a simple mistake


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: jackg on December 03, 2020, 05:20:40 PM
Have you tried to CD into the directory and running it directly from there with ./Bitcoind? If it worked then then you'll just have to search up on how to make the bitcoin command link to the exectible.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: bob123 on December 03, 2020, 06:17:30 PM
Did you check the permission of the file? Type:
Code:
ls -al /usr/local/bin/

Are you logged in as root instead of a unprivileged user using sudo?

Check whether /usr/local/bin/ is in your $PATH by typing:
Code:
$PATH


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: mocacinno on December 03, 2020, 06:25:11 PM
This line worries me:
cd ~/usr/local/bin/

There is a huge difference between
~/usr/local/bin/
And
/usr/local/bin/

The first one starts from your home, the other from root

The first one probably isn't in your path, the second one probably is...

Can you try:
which bitcoind


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: brethberie on December 04, 2020, 02:08:50 AM
Have you tried to CD into the directory and running it directly from there with ./Bitcoind? If it worked then then you'll just have to search up on how to make the bitcoin command link to the exectible.

I did try this and it returned "cannot execute binary file" This made me realize I had not installed ARM Linux version of Bitcoin Core. I have restarted a half dozen times with the proper download now and am encountering serious issues.

The primary concern is that I can't verify the download. sha256sum of the file I've downloaded does not match any on the SHA256SUMS.asc file I obtained from bitcoincore.org

The secondary concern is that the Linux install instructions at bitcoin.org/en/full0node#linux-instructions do not seem to apply to the ARM Linux version.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: brethberie on December 04, 2020, 02:15:09 AM
Did you check the permission of the file? Type:
Code:
ls -al /usr/local/bin/

Are you logged in as root instead of a unprivileged user using sudo?

Check whether /usr/local/bin/ is in your $PATH by typing:
Code:
$PATH

Started over with the proper ARM Linux download. Extracted the download and ran: sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.20.1-arm-linux-gnueabihf.tar-3

ls -al /usr/local/bin returns "root root" for permissions on the bitcoin file in the directory

Would love some instructions specific to ARM Linux but none seem to exist.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: brethberie on December 04, 2020, 02:59:10 AM
This line worries me:
cd ~/usr/local/bin/

There is a huge difference between
~/usr/local/bin/
And
/usr/local/bin/

The first one starts from your home, the other from root

The first one probably isn't in your path, the second one probably is...

Can you try:
which bitcoind



~/usr/local/bin/ was a mistake on my part. I've been using /usr/local/bin/ and can confirm I am running everything from root. This is all happening on a clean verified install of Ubuntu for Raspberry Pi.

Followed the instructions here
https://stadicus.github.io/RaspiBolt/raspibolt_30_bitcoin.html
Was able to get all the way back to where I was last night with the proper ARM version of Bitcoin core (and verify the download this time). I now have bitcoin-cli, bitcoind, etc. in the /usr/local/bin directory as outlined in the RaspiBolt instructions.
However when I run: bitcoind --version          
I get bash: /usr/local/bin/bitcoind: No such file or directory
When I run: which bitcoind
I get: /usr/local/bin/bitcoind

I have also tried to run: sudo ./bitcoind , sudo ./bitcoin-qt ,etc. with no other results. I have tried this in a tmp directory and a normal one.  


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: ranochigo on December 04, 2020, 03:11:07 AM
However when I run: bitcoind --version          
I get bash: /usr/local/bin/bitcoind: No such file or directory
When I run: which bitcoind
I get: /usr/local/bin/bitcoind

I have also tried to run: sudo ./bitcoind , sudo ./bitcoin-qt ,etc. with no other results. I have tried this in a tmp directory and a normal one.  
Might sound quite trivial but is it executable? Navigate to the directory and pass chmod +x bitcoind into the command line. I've been running Raspbian and I had to do this so it might be applicable to you.

I assume you're getting the hash of the entire tar.gz file? The hash should be 55b577e0fb306fb429d4be6c9316607753e8543e5946b542d75d876a2f08654c for the arm version.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: brethberie on December 04, 2020, 03:59:48 AM
However when I run: bitcoind --version          
I get bash: /usr/local/bin/bitcoind: No such file or directory
When I run: which bitcoind
I get: /usr/local/bin/bitcoind

I have also tried to run: sudo ./bitcoind , sudo ./bitcoin-qt ,etc. with no other results. I have tried this in a tmp directory and a normal one.  
Might sound quite trivial but is it executable? Navigate to the directory and pass chmod +x bitcoind into the command line. I've been running Raspbian and I had to do this so it might be applicable to you.

I assume you're getting the hash of the entire tar.gz file? The hash should be 55b577e0fb306fb429d4be6c9316607753e8543e5946b542d75d876a2f08654c for the arm version.

I solved the issue with the hash. I was attempting to verify the unzipped file.

I did run:
sudo chmod +x bitcoind
This did not change anything regarding the errors from before. Still getting no such file or directory for /usr/local/bin/bitcoind


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: NotATether on December 04, 2020, 05:40:06 AM
Did you copy the libraries to /usr/local/lib as well? Those also have to be copied not just /usr/local/bin binaries. In fact I would run cd bitcoin-core-download-folder && cp * /usr/local so that all the files are copied to /use/local/bin|lib|share|etc and so on. (Obviously replace bitcoin-core-download-folder with the real download path)

Also check this question out:

Running executable file: No such file or directory (https://unix.stackexchange.com/questions/413642/running-executable-file-no-such-file-or-directory) (Unix stack exchange)

From an answer there, check if any dependent libraries are not found by running:

Code:
ldd /usr/local/bin/bitcoind

And it will print if any libraries are not found. If that's the case then you didn't copy all of the files to /usr/local.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: mocacinno on December 04, 2020, 06:51:35 AM
When i replied yesterday, it was from my cellphone, so i couldn't really dig into this one...

If I was faced with such a problem, i'd probably do the following things (some steps were already done, but i listed them anyways for future reference):

1) check if bitcoind was in my path [already done]
Code:
which bitcoind
which bitoin-cli

If you see a reply like yours: /usr/local/bin/bitcoind it means bitcoind is in your path... This is the best case scenario.
If, however, you don't get a full path back, you have 2 sollutions:
  • a) move the binaries to a dir that's in your path
  • b) add the folder where your binaries are located to your path

a) you can find which directory's are in your path by executing "echo $PATH"
b) add the line export PATH=/[path were binaries are located]:$PATH to ~/.bashrc and execute "source ~/.bashrc" (or log out and back in again)

2) once you are sure bitcoind is in your path, make sure it's an executable binary
given your path, the commands should go a little bit like this:
Code:
file /usr/local/bin/bitcoind
file /usr/local/bin/bitcoin-cli

The stdout on my node:
/usr/local/bin/bitcoind: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=3a439a31a5157ff7052ed310050df5643a02ea3f, stripped

If you see something like ASCII or compressed data, or whatever that doesn't point to the file being an executable... It might be best to check if you indeed downloaded the correct binary and unpacked it properly

3) check your file's permissions
Code:
cd /usr/local/bin
ls -ltrh *bitcoin*

I'm not going to give a full lecture on permissions here... But the basics are pretty simple: you're interested in the lines containing the string bitcoind and bitcoin-cli
you want these lines to have the executable permission (the letter x should be shown 3 times at the start of the line)

For example, on my machine:
-rwxr-xr-x 1 root root 9.9M Nov 16 13:35 bitcoind

This line basically means: bitcoind is owned by user root, group root.
The owner (root) has read, write and execute permissions:
-rwxr-xr-x 1 root root 9.9M Nov 16 13:35 bitcoind

The group (root) has read and execute permissions:
-rwxr-xr-x 1 root root 9.9M Nov 16 13:35 bitcoind

Any other user has read and execute permissions:
-rwxr-xr-x 1 root root 9.9M Nov 16 13:35 bitcoind

Now, you can check who you are by executing
Code:
whoami

Then see your id and to which groups you belong by executing
Code:
id

Based on who you are, you can infer if the permissions allow you to execute the binary

If you don't have the necessary permissions, you can either look up how to set the correct permissions for your user, or you can do:
chmod +x bitcoind
chmod +x bitcoin-cli

4) last but not least, check if there are missing deps
Code:
ldd /usr/local/bin/bitcoind
ldd /usr/local/bin/bitcoin-cli

If you find missing dependencies, you either have to move library's to a library path or install them using apt-get (in your case, since you're running ubuntu... on other distro's you might have to use a different tool, like zypper, yast, yum, rpm,...).
Usually, you can find the dirs in the library path in config files stored here:
/etc/ld.so.conf.d/



Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: Carlton Banks on December 04, 2020, 10:58:30 AM
bitcoin-0.20.1-arm-linux-gnueabihf.tar-3

this part may be your issue                                                    


what you want is bitcoin-0.20.1-aarch64-linux-gnu.tar.gz

NOT bitcoin-0.20.1-arm-linux-gnueabihf.tar.gz


you appear to be using the arm-v7 arch, when in fact you would need the arm-v8 64-bit arch build, the RPi 4 uses the arm-v8/aarch64 ISA


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: brethberie on December 04, 2020, 04:13:03 PM
bitcoin-0.20.1-arm-linux-gnueabihf.tar-3

what you want is bitcoin-0.20.1-aarch64-linux-gnu.tar.gz

NOT bitcoin-0.20.1-arm-linux-gnueabihf.tar.gz

you appear to be using the arm-v7 arch, when in fact you would need the arm-v8 64-bit arch build, the RPi 4 uses the arm-v8/aarch64 ISA

This was it. I followed the instructions here https://stadicus.github.io/RaspiBolt/raspibolt_30_bitcoin.html
this time using the aarch64-Linux download of bitcoin core which I found at bitcoin.org/bin/bitcoin-core-0.20.1/

Any idea why this option isn't shown on the list of downloads at either bitcoin.org or bitcoincore.org? I'm also confused about why the arm-Linux version worked for other people doing installs on the Raspberry Pi. Maybe it works on Ubuntu Server but not Ubuntu Desktop? I'm not familiar enough with architecture differences to know.  

Thank you to all that helped me out.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: NotATether on December 04, 2020, 09:10:31 PM
Any idea why this option isn't shown on the list of downloads at either bitcoin.org or bitcoincore.org? I'm also confused about why the arm-Linux version worked for other people doing installs on the Raspberry Pi. Maybe it works on Ubuntu Server but not Ubuntu Desktop? I'm not familiar enough with architecture differences to know.  

According to this (https://www.programmersought.com/article/2030933178/), gnueabihf is for ARMv7 32-bit systems, while aarch64 is for ARMv8 64-bit systems. Raspberry Pi 4 runs an ARMv8 processor, and your ubuntu install is probably 64-bit ARM, hence the bitcoin core incompatibilities.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: Carlton Banks on December 04, 2020, 09:46:42 PM
Any idea why this option isn't shown on the list of downloads at either bitcoin.org or bitcoincore.org? I'm also confused about why the arm-Linux version worked for other people doing installs on the Raspberry Pi. Maybe it works on Ubuntu Server but not Ubuntu Desktop? I'm not familiar enough with architecture differences to know.  

According to this (https://www.programmersought.com/article/2030933178/), gnueabihf is for ARMv7 32-bit systems, while aarch64 is for ARMv8 64-bit systems. Raspberry Pi 4 runs an ARMv8 processor, and your ubuntu install is probably 64-bit ARM, hence the bitcoin core incompatibilities.

it's weird, like @brethberie I also don't quite understand the architecture differences. I remember from my Windows days (now so long ago :)) that 32-bit binaries worked no problem on 64bit systems or OS'es (but 32bit binaries could still only address a maximum 3GB physical address space). At a guess, I would say the actual CPU instruction sets of ArmV7 and ArmV8 are mutually incompatible.

anyway, glad you got it working brethberie. be sure to make a note of all the suggestions everyone else contributed, as they're all great tools to solve linux config problems


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: armitage819 on December 11, 2020, 06:54:52 PM
I'm in exactly the same situation, trying to set up bitcoind and lnd on a new Pi 400 and experiencing the same error. I've followed everything in this thread, with no luck:

Downloaded and unzipped bitcoin-0.20.1-aarch64-linux-gnu.tar.gz

Code:
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.20.1/bin/*

Code:
bitcoind -daemon
outputs "/usr/local/bin/bitcoind: No such file or directory" even though it most definitely exists.

Code:
which bitcoind
outputs "/usr/local/bin/bitcoind"

I tried running it directly from usr/local/bin, with sudo, etc. to no effect.

Code:
file /usr/local/bin/bitcoind
ouputs "ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=c8a1b5803e81c3a82a723a6867ca63dd25ca9cc5, stripped"
..which looks right.

Code:
ls -ltrh *bitcoin*
outputs: "-rwxr-xr-x 1 root root 1.8M Dec 11 00:53 bitcoin-cli
-rwxr-xr-x 1 root root 9.1M Dec 11 00:53 bitcoind
-rwxr-xr-x 1 root root  30M Dec 11 00:53 bitcoin-qt
-rwxr-xr-x 1 root root 2.1M Dec 11 00:53 bitcoin-tx
-rwxr-xr-x 1 root root 5.2M Dec 11 00:53 bitcoin-wallet
-rwxr-xr-x 1 root root  15M Dec 11 00:53 test_bitcoin"

..which looks right.

And here's the new part: When I run
Code:
ldd /usr/local/bin/bitcoind
it outputs "not a dynamic executable"

The advice on this error I've been able to find is not specific to this situation and suggests deleting it, making sure all packages are up to date, and trying again - which I did. No effect.

Any ideas? I really appreciate the help.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: NotATether on December 12, 2020, 01:55:15 AM
I'm in exactly the same situation, trying to set up bitcoind and lnd on a new Pi 400 and experiencing the same error. I've followed everything in this thread, with no luck:

The issue is in this line:

Quote
Code:
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.20.1/bin/*

You need to copy the entire bitcoin directory to /usr/local. Change it to this command instead:

Code:
sudo install -m 0755 -o root -g root -t /usr/local bitcoin-0.20.1/*

In general, you should not be installing programs by copying only their bin/ folders.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: armitage819 on December 12, 2020, 04:36:32 PM
You need to copy the entire bitcoin directory to /usr/local. Change it to this command instead:

Code:
sudo install -m 0755 -o root -g root -t /usr/local bitcoin-0.20.1/*

In general, you should not be installing programs by copying only their bin/ folders.

D'oh. Much appreciated!


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: armitage819 on December 12, 2020, 06:23:40 PM
Change it to this command instead:

Code:
sudo install -m 0755 -o root -g root -t /usr/local bitcoin-0.20.1/*

In general, you should not be installing programs by copying only their bin/ folders.

I gave this a try, but it omitted every directory, and when I tried adding -d, it responded "install: target directory not allowed when installing a directory." I then manually copied the contents of each directory into local/lib, local/share, etc. with cp -a but still have the same issues.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: NotATether on December 12, 2020, 11:44:07 PM
Change it to this command instead:

Code:
sudo install -m 0755 -o root -g root -t /usr/local bitcoin-0.20.1/*

In general, you should not be installing programs by copying only their bin/ folders.

I gave this a try, but it omitted every directory, and when I tried adding -d, it responded "install: target directory not allowed when installing a directory." I then manually copied the contents of each directory into local/lib, local/share, etc. with cp -a but still have the same issues.

Try running:

Code:
cp -ra bitcoin-0.20.1/* /usr/local

The -r flag forces it to copy child directories.

If you do this and you still have the same problem executing Bitcoin Core as the OP, run uname -a and post the output here so we at least know your system architecture, whether it's something other than aarch64.



Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: hypersex on May 01, 2024, 11:08:52 PM
Hello.

I'm bumping this issue because I still have this issue with Bitcoin Core version 27, and I have tried everything mentioned here.

bicoin core release: bitcoin-27.0-aarch64-linux-gnu.tar.gz

When I try to execute the binaries

Code:
$ bitcoin-cli --version # same when trying to execute bitcoind and trying to execute directly from the /usr/local/bin folder
-bash: /usr/local/bin/bitcoin-cli: No such file or directory

I also tried @NotATether approach by cp -ra all files directly to /usr/local, and it still didn't work. FYI, this approach made the files be owned by my user, not by the root.

Code:
-rwxr-xr-x  1 pi pi  2150424 Apr 15 17:28 bitcoin-cli
-rwxr-xr-x  1 pi pi 40236344 Apr 15 17:28 bitcoin-qt
-rwxr-xr-x  1 pi pi  3928144 Apr 15 17:28 bitcoin-tx
-rwxr-xr-x  1 pi pi  1855064 Apr 15 17:28 bitcoin-util
-rwxr-xr-x  1 pi pi  8966416 Apr 15 17:28 bitcoin-wallet
-rwxr-xr-x  1 pi pi 14473240 Apr 15 17:28 bitcoind

Other information:

Code:
$ ldd /usr/local/bin/bitcoind
not a dynamic executable

Code:
$ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

I'm following this tutorial https://raspibolt.org/guide/bitcoin/bitcoin-client.html

I run out of ideas :\

Any suggestions?

Thank you


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: achow101 on May 01, 2024, 11:38:47 PM
As the error suggests, the files are not in /usr/local/bin and so cannot be found to be executed. Make sure that they are there.

What commands have you specifically done in order to try to install the binaries, and what is their output?



This is an issue with your own installation, no new/alternate version of Bitcoin Core is going to fix this for you.


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: hypersex on May 01, 2024, 11:42:33 PM
As the error suggests, the files are not in /usr/local/bin and so cannot be found to be executed. Make sure that they are there.

What commands have you specifically done in order to try to install the binaries, and what is their output?



This is an issue with your own installation, no new/alternate version of Bitcoin Core is going to fix this for you.

I know that is my installation, but I don't know what I'm doing wrong.

The files are there, this output is from running ls -la inside /usr/local/bin

Code:
-rwxr-xr-x  1 pi pi  2150424 Apr 15 17:28 bitcoin-cli
-rwxr-xr-x  1 pi pi 40236344 Apr 15 17:28 bitcoin-qt
-rwxr-xr-x  1 pi pi  3928144 Apr 15 17:28 bitcoin-tx
-rwxr-xr-x  1 pi pi  1855064 Apr 15 17:28 bitcoin-util
-rwxr-xr-x  1 pi pi  8966416 Apr 15 17:28 bitcoin-wallet
-rwxr-xr-x  1 pi pi 14473240 Apr 15 17:28 bitcoind

The commands were:

Code:
$ tar -xvf bitcoin-$VERSION-aarch64-linux-gnu.tar.gz
$ sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-27.0/bin/*

I also tried to copy all content from the tar.gz by running:

Code:
$ sudo install -m 0755 -o root -g root -t /usr/local bitcoin-27.0/*

But some folders were omitted. Then I try copying with

Code:
cp -ra bitcoin-27.0/* /usr/local


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: achow101 on May 02, 2024, 04:28:20 AM
Try removing all of your install attempts from your system and start over from scratch. The first install command of just the bin/ directory should work.

Also check that you can execute any other binary that already exists in /usr/local/bin, and that you can run any of the binaries from where you've untar'd them before installing.

What is your PATH environment variable set to? Check it with
Code:
echo $PATH

 What do you get if you do
Code:
which bitcoind
which bitcoin-cli


Title: Re: /ur/local/bin/bitcoind not found Ubuntu Desktop for Raspberry Pi4
Post by: NotATether on May 02, 2024, 07:55:58 AM
Code:
cp -ra bitcoin-27.0/* /usr/local


Permission issues can be resolved by using sudo before the command:

Code:
sudo cp -ra bitcoin-27.0/* /usr/local

but that won't solve the executable issue.

Try making bitcoind executable using chmod +x and see what happens when you run it.

Also post the output of:

Code:
file /usr/local/bin/bitcoind
stat /usr/local/bin/bitcoind

as LDD should not fail unless the file isn't actually a program.

It should say something like:

Code:
/usr/local/bin/bitcoind: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped