I installed geth on a 64-bit Ubuntu 16.04 by building from source (as described here), and I can run the program as follows:

~$ 'path_to/go-ethereum/build/bin/geth' ...

However, I want to run it with just the command geth. I tried to set an alias in ./bashrc:

alias geth='path_to/go-ethereum/build/bin/geth'

Now it works when I type geth in the terminal, however, -I think- it fails when a script calls the command. In my case, the command populus deploy Greeter --chain local_test yields an error as follows:

  File "/usr/local/lib/python2.7/dist-packages/geth/accounts.py", line 133, in ensure_account_exists
    accounts = get_accounts(data_dir, **geth_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/geth/accounts.py", line 31, in get_accounts
ValueError: Error trying to list accounts
Command    : nice -n 20 geth --rpc --rpcaddr --rpcport 8545 --rpcapi admin,debug,eth,miner,net,personal,shh,txpool,web3,ws --ws --wsaddr --wsport 8546 --wsapi admin,debug,eth,miner,net,personal,shh,txpool,web3,ws --datadir /home/me/populus/chains/local_test --maxpeers 0 --networkid 1234 --port 30303 --ipcpath /home/me/populus/chains/local_test/geth.ipc --ipcapi admin,debug,eth,miner,net,personal,shh,txpool,web3,ws --verbosity 5 --unlock 0 --password /usr/local/lib/python2.7/dist-packages/geth/default_blockchain_password --nodiscover --mine --minerthreads 1 account list
Return Code: 127
stdout: N/A
`nice: ‘geth’: No such file or directory

Finally, I tried to install geth with npm, but after a series of -probably badly ordered- package installations, when I call sudo apt-get install ethereum, I get this error:

The following packages have unmet dependencies:
 ethereum : Depends: geth but it is not going to be installed
            Depends: bootnode but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When I try to install geth beforehand with sudo apt-get install geth, I get the following error:

The following packages have unmet dependencies:
 geth : Depends: ttf-ancient-fonts but it is not installable

The issue is already discussed here but the solution proposed (sudo apt-get update && sudo apt-get upgrade before installation) did not work for me, so I'm stuck at this point.

Should I try to clean things and install with npm, or is there a way to make it work with this build? Any help would be appreciated.


1 Answer 1


1 Set Alias

Your aliases will not work with scripts. As scripts only have to be set up once, you could just encode the full path name of the executable.

Otherwise, you can either:

  1. Create a soft link for geth in $HOME/bin

    cd $HOME/bin
    ln -s path_to/go-ethereum/build/bin/geth geth
  2. Create a soft link for geth in /usr/local/bin

    cd /usr/local/bin
    ln -s path_to/go-ethereum/build/bin/geth geth

Use 1. above if you have already created a $HOME/bin directory, if you have executables that you run from it, and your script can access the executables in this directory (if you run the scripts from your user account).

Otherwise use 2. above.


From Installation Instructions for Ubuntu:

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum

Did you execute all the commands above in the correct order?

  • 1
    Thanks for your answer. For the installation part, yes, I ran the exact same commands but I got the error I mentioned. However, they worked in another (fresh) Ubuntu installation.
    – jeff
    Commented Nov 4, 2016 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.