Litecoin-cli - how to run it on Ubuntu?

Hi! I would like to run litecoin-cli so I can send different combinations of passphrase to unlock my wallet (I remember words used, but don’t remember combination). I’m on Ubuntu (Please note: I’m not good in Linux and programming).

In my home directory I’ve got these folders: litecoin-0.10.4.0 and .litecoin.

When in terminal and in home_directory/litecoin-0.10.4.0/bin I type ./litecoin-cli I receive information about Litecoin Core RPC etc. Then, for example, when I want to (according to this API: https://litecoin.info/Litecoin_API) check LTC address (by typing “litecoin-cli validateaddress litecoinaddress” in terminal) I receive: “litecoin-cli: command not found” (translating information from my native language).

I’ve read, that for litecoind two files must be created to run it: litecoin.conf and data folder. Does the same apply to litecoin-cli? In which folders must I create litecoin.conf and data folder - in litecoin-0.10.4.0/bin or in .litecoin?

Thank you in advance! P.

having a hard time running litecoin in linux myself as well so I saved it for another day but I do remember something about you cannot run “applications” in Linux from a root directory…you have to use a user directory or something like that…then all should work fine…thats how I got cgminer working in linux anyway…

bakd247, thank you for your reply. As I mentioned above, I’m not good in Linux, but on the assumption that litecoin-qt is an “application” I have no problem starting it from the terminal (writing ./litecoin-qt command being in appropriate directory), so probably that is not an issue…

Please try the command

Let us know if there’s a solution!

If you want to run Litecoin Core in terminal, then you have to symlink the daemon and cli binaries. Only then can you do something like ./litecoind to start Litecoin, without specifying the directory that you are storing the binaries in.

So to do this, first you need to find out the location of you Litecoin directory:

cd litecoin-folder
pwd

Then once you’ve found this out, you have to symlink it:

ln -s litecoin-folder/litecoind /usr/bin/litecoind
ln -s litecoin-folder/litecoin-cli /usr/bin/litecoin-cli
ln -s litecoin-folder/litecoin-qt /usr/bin/litecoin-qt

(where litecoin-folder is the directory you found when you typed pwd)

The litecoin.conf and the .litecoin/ data directory will be automatically be created when you first start litecoin by starting the litecoind daemon (by doing: ./litecoind). To use any of the command line options, you must use ./litecoin-cli.

losh11, thank you for your reply. I managed to run litecoin-cli the similar way. This is for others, who might find it helpful:

  1. litecoin.conf and data folder have to in .litecoin folder.
  2. Then you have to run litecoind, by, while in terminal, going to the directory where litecoind is and typing ./litecoind -daemon → that starts litecoin server.
  3. Now, after a while, you can use litecoin-cli - type ./litecoin-cli and an appropriate command from litecoin API (https://litecoin.info/Litecoin_API).
1 Like