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]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 binarygiven your path, the commands should go a little bit like this:
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 permissionscd /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:
-rwx
r-xr-x 1 root root 9.9M Nov 16 13:35 bitcoind
Any other user has read and execute permissions:
-rwxr-x
r-x 1 root root 9.9M Nov 16 13:35 bitcoind
Now, you can check who you are by executing
Then see your id and to which groups you belong by executing
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 depsldd /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/