electrum-ltc
electrum-ltc copied to clipboard
Electrum LTC installation instructions don't work on Tails linux
Hello, I've been trying to install Electrum LTC on tails Linux, but the published instructions don't work on a fresh live USB installation (persistent storage is enabled).
The install instructions are as follows:
sudo apt-get install python-qt4 python-pip python-dev sudo pip2 install https://electrum-ltc.org/download/Electrum-LTC-2.9.3.1.tar.gz electrum-ltc
The first line runs (but only after "sudo apt-get update"). But the second line returns some errors and Electrum will not install.
I know that the Bitcoin version of the Electrum wallet is pre-installed on Tails, how about getting Electrum LTC included in the standard distro?
Here is the error, any updates to fix the install instructions would be most appreciated:
sudo pip2 install https://electrum-ltc.org/download/Electrum-LTC-2.9.3.1.tar.gz Collecting PySocks>=1.6.6 (from Electrum-LTC==2.9.3.1) Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run wb.build(autobuilding=True) File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file require_hashes File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 278, in populate_link self.link = finder.find_requirement(self, upgrade) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 465, in find_requirement all_candidates = self.find_all_candidates(req.name) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 423, in find_all_candidates for page in self._get_pages(url_locations, project_name): File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_pages page = self._get_page(location) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 683, in _get_page return HTMLPage.get_page(link, session=self.session) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 792, in get_page "Cache-Control": "max-age=600", File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get return self.request('GET', url, **kwargs) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 386, in request return super(PipSession, self).request(method, url, *args, **kwargs) File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send resp = super(CacheControlAdapter, self).send(request, **kw) File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send timeout=timeout File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment total -= 1 TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
This appears to be an issue with your version of pip, triggered by a network error. See these links: https://stackoverflow.com/questions/37495375/python-pip-install-throws-typeerror-unsupported-operand-types-for-retry https://stackoverflow.com/questions/42610545/typeerror-unsupported-operand-types-for-retry-and-int-during-pip https://bitcointalk.org/index.php?topic=2242265.0
Thanks appreciate that but I've already been through all of those links to no avail, the other method of pip installation doesn't work either on Tails. I think the overarching issue here is that working installation instructions should be provided for a Tails installation, which is likely to be a popular use case. I don't know enough about Tails/Linux to debug these issues and the info I've found hasn't been useful so far.
Got this to work on Tails with the following. Error are being caused due to connectivity issue via onion network setup in Tails. Also Seems the elevated account will not allow this install so no sudo. Tails probably this by design. Ensure to set admin password when Tails initially boots. I can install it as the live CD user with the following commands. Make sure to disconnect internet before launching electrum-ltc if you are just generating a wallet
. torsocks on
sudo apt-get update
sudo apt-get install python-qt4 python-pip python-dev build-essential python-setuptools
pip2 install https://electrum-ltc.org/download/Electrum-LTC-2.9.3.1.tar.gz
cd ~/.local/bin
./electrum-ltc
@elproducto many thanks for this, I've successfully used it to install and run Electrum LTC on my tails installation. However, it doesn't seem to persist between boots, despite having all the persistent storage options enabled, e.g. ...
- APT Packages
- APT Lists
- Dotfiles
Directory ~/.local/bin with the electrum ltc executable (and other ~/.local stuff created during the install) no longer exists.
Any ideas?
Ok, I've found the documentation for installing additional software: https://tails.boum.org/doc/first_steps/persistence/configure/index.en.html#additional_software The problem with that is: a) It's slow, having to install those packages at boot. b) It doesn't take care of the pip2 install electrum LTC command (and even if it did, this would add to the boot time). c) Any wallets generated by Electrum LTC in the default location are wiped on subsequent boots (unless it's manually saved to a persistent directory after initial creation).
So currently, Tails doesn't really seem fit for using Electrum LTC unless Tails starts bundling it with their default distro...
Ok, so this is the roundabout solution I'm thinking of.
- Add the apt-get packages to /live/persistence/TailsData_unlocked/live-additional-software.conf
- Manually run the pip install for electrum
- Move the newly created directories in ~/.local to a persistent home directory
- Follow this guide to add a shell script to autostart on Tails boot https://www.reddit.com/r/tailswiki/wiki/index/tails-autorun-at-startup
- Shell script creates symbolic links from ~/.local to persistent directories created in step 4. and desktop shortcuts to Electrum LTC
Hopefully this will then make it possible to not need to re-run the electrum-ltc installation. Am I overthinking this? Do I need the shell script or can the binaries be safely moved to a persistent directory somehow without requiring symlinks?
Cheers
I've made some progress, my use case above can be achieved by using the tails "dotfiles" persistence feature. Once I've got everything set up I'll see if I can provide a full guide for others to follow who run into this problem.
Ok, I have this working acceptably. I've not tried sending/receiving LTC yet though, fingers crossed that works ok. Thank you to those who replied! (Tagging @pooler in case you think this should be added to the wiki or somewhere else...).
Steps to install/configure Electrum-LTC with Tails:
- Install Live USB Tails OS using setup instructions provided on the Tails site (https://tails.boum.org/install/os/).
- Boot into Tails.
- Create a persistent storage location (Applications > Tails > Configure persistent volume). Ensure that the following items are selected and any others you might want:
- APT Packages
- APT Lists
- Dotfiles
- Reboot Tails.
- In the Tails Greeter: a) Unlock persistent storage. b) Add additional option: admin password.
- Start tails.
- Open a terminal window (Applications > Favorites > Terminal).
- Enter the following commands to install and run Electrum LTC:
. torsocks on sudo apt-get update sudo apt-get install python-qt4 python-pip python-dev build-essential python-setuptools pip2 install https://electrum-ltc.org/download/Electrum-LTC-2.9.3.1.tar.gz cd ~/.local/bin ./electrum-ltc
(After any sudo-prefixed commands you'll be prompted for the password you entered in step 5. b). 9. Create/restore your wallet using the Electrum LTC GUI (this part should probably be done while offline for extra security precaution). Make a note of the wallet file name. 10. Close Electrum LTC 11. Enter the following commands to make your installation and settings persist on the next boot of Tails (for more detailed info on this see: https://tails.boum.org/doc/first_steps/persistence/configure/index.en.html#index13h2):
cd /live/persistence/TailsData_unlocked/dotfiles sudo cp -p -r ~/.local . sudo cp -p -r ~/.electrum-ltc .
(Basically copy everything in /home/amnesia/.local and .electrum-ltc to the persistent area so it is restored when you reboot tails)
- Enter the following commands to create a desktop shortcut
sudo mkdir Desktop cd Desktop
Create a file here called .electrum-ltc.desktop with the following contents (replace "default_wallet" with the file name of the wallet you created/restored in step 9):
[Desktop Entry] Comment=Lightweight Litecoin Client Exec=/home/amnesia/.local/bin/electrum-ltc -w /home/amnesia/.electrum-ltc/wallets/default_wallet GenericName[en_US]=Litecoin Wallet GenericName=Litecoin Wallet Icon=electrum-ltc Name[en_US]=Electrum Litecoin Wallet Name=Electrum Litecoin Wallet Categories=Finance;Network;
Save this and then run the following command in the terminal (ensures the desktop file is executable)
sudo chmod o+rx .electrum-ltc.desktop
- Reboot tails, ensuring you unlock persistent storage in the greeter etc.
- You should now see a link on your desktop for Electrum LTC, you must double-click and then Allow/Trust to run it. It should open the GUI directly on the wallet you created, if you specified the wallet path in the Exec option of the desktop file.
Hope that helps someone else out.
Hi @alxglover, very sorry for the delay! (I'm answering here to your question in issue #48).
As I mentioned, I have Electrum reading/writing from/to pendrives (USB sticks), one for the cold storage one for the watching only part. This approach allows to switch Tails version at any moment, and also to boot Tails from DVD to go online with the watching only part, so the OS files can not get tempered with while online, leaving the system compromised.
Pasting scripts here.
Long names help me not to forget what is what, sometimes I don't use this stuff during a long while. Of course I use automatic filename completion in the bash shell with the TAB key.
My cold storage and watching only pendrives are clearly identifiable and encrypted with different (strong) passphrases, so I don't accidentally go online with the cold storage one mounted (although we certainly put very strong passwords on the Electrum wallets).
I've also changed certain names, in cold storage vs. watching only, to make sure that I know what I'm doing when calling scripts and manipulating folders:
- In cold storage, script names start by OFFLINE_, precisely OFFLINE_LTCdoUpdateDotElectrumBkup.sh and OFFLINE_LTCprepAndLaunchElectrum.sh which is a symlink to OFFLINE_LTCprepAndLaunchElectrum_2.9.3.1.sh
- The dot/ folder is dot_PRIVATE/ on the cold storage pendrive
(it's the folder which contains the .electrum-ltc-versionInfo folders, one for each version of Electrum I want to keep handy, id est the folders which in turn get linked into the home dir as .electrum-ltc;
when you want to use a new version of Electrum, you download, check the signature, compress with 7z with password into a file like eleLTC_2.9.3.1.7z (7z a eleLTC_2.9.3.1.7z Electrum-LTC-2.9.3.1.tar.gz -mhe=on -p
) and put it into the folder that you'll figure out from the script, actually a path of your choice, in both the cold storage and watching only pendrives, then in the dot/ and dot_PRIVATE/ folders you copy the whole .electrum-ltc-versionInfo folder in use with the previous Electrum version for the new version, e.g.
cp -a .electrum-ltc-2.9.3.1 .electrum-ltc-2.9.3.2
and the prepAndLaunch script will link it into the home dir as .electrum-ltc).
Now the scripts.
Initally I figured out this way for Electrum BTC. I maintain the same flow for LTC so it should be ok when Tails comes with Electrum-LTC preinstalled. The test before rm -rf could be omitted.
You'll notice that I'm not a sophisticated bash programmer at all, the simpler the better to me.
LTCprepAndLaunchElectrum.sh (actually a symlink to LTCprepAndLaunchElectrum_2.9.3.1.sh which is my default):
#!/bin/bash
set -e
cd /home/amnesia
echo ""
echo "Going to replace amnesic /home/amnesia/.electrum-ltc folder with symlink to the persistent one which contains watching-only related data."
echo "press ctrl-c to cancel or any other key to continue..."
read -s -N 1 SELECT
rm -rf .electrum-ltc
ln -s /media/amnesia/watchOnly/somePath/ofYourChoice/LTC/dot/.electrum-ltc-2.9.3.1 .electrum-ltc
echo ""
echo ""
echo "7z going to extract .tar.gz of Electrum-LTC-2.9.3.1 (it will ask for 7z password) then tar will extract the tree with executable electrum-ltc"
FILE="Electrum-LTC-2.9.3.1.tar.gz" ; if [ -f "$FILE" ]; then rm "$FILE" ; fi
FOLDER="Electrum-LTC-2.9.3.1" ; if [ -d "$FOLDER" ]; then rm -rf "$FOLDER" ; fi
7z x /media/amnesia/watchOnly/somePath/ofYourChoice/LTC/eleLTC_2.9.3.1.7z
echo ""
echo ""
echo "Tar extracting tree with executable electrum-ltc"
tar -zxvf Electrum-LTC-2.9.3.1.tar.gz 1> /dev/null
echo ""
echo ""
echo "Going to execute: cd /home/amnesia/Electrum-LTC-2.9.3.1/ ; ./electrum-ltc"
cd /home/amnesia/Electrum-LTC-2.9.3.1/
./electrum-ltc
echo ""
echo ""
echo "To launch electrum again:"
echo "cd /home/amnesia/Electrum-LTC-2.9.3.1/"
echo "./electrum-ltc"
echo ""
echo "Then you may want to issue:"
echo "/media/amnesia/watchOnly/LTCdoUpdateDotElectrumBkup.sh"
/media/amnesia/watchOnly/LTCdoUpdateDotElectrumBkup.sh
cd /home/amnesia/Electrum-LTC-2.9.3.1/
# ^ Leaves in folder of executable PROVIDED this script was called with ". scriptPath/name" or "source scriptPath/name".
# https://unix.stackexchange.com/questions/27139/script-to-change-current-directory-cd-pwd
# https://stackoverflow.com/questions/874452/change-current-directory-from-a-script
# "The . will evaluate the script in the current environment, so it might be altered."
LTCdoUpdateDotElectrumBkup.sh
#!/bin/bash
set -e
echo ""
echo "Going to update backup of watchonly .electrum-ltc folder (pointed to by symlink in amnesic home dir /home/amnesia/)"
echo "press ctrl-c to cancel or any other key to continue..."
read -s -N 1 SELECT
pushd /media/amnesia/watchOnly/somePath/ofYourChoice/LTC/
#----------------------------------------
# Basically going to do the following but with preliminary test that each file exists:
# mv dotElectrumLTC_WATCH-ONLY_oold.tgz dotElectrumLTC_WATCH-ONLY_ooold.tgz
# mv dotElectrumLTC_WATCH-ONLY_old.tgz dotElectrumLTC_WATCH-ONLY_oold.tgz
# mv dotElectrumLTC_WATCH-ONLY.tgz dotElectrumLTC_WATCH-ONLY_old.tgz
if [ -f "dotElectrumLTC_WATCH-ONLY_oold.tgz" ]; then mv "dotElectrumLTC_WATCH-ONLY_oold.tgz" "dotElectrumLTC_WATCH-ONLY_ooold.tgz" ; fi
if [ -f "dotElectrumLTC_WATCH-ONLY_old.tgz" ]; then mv "dotElectrumLTC_WATCH-ONLY_old.tgz" "dotElectrumLTC_WATCH-ONLY_oold.tgz" ; fi
if [ -f "dotElectrumLTC_WATCH-ONLY.tgz" ]; then mv "dotElectrumLTC_WATCH-ONLY.tgz" "dotElectrumLTC_WATCH-ONLY_old.tgz" ; fi
#----------------------------------------
tar -zcvf dotElectrumLTC_WATCH-ONLY.tgz dot/ 1> /dev/null
popd
# ^ Uninfluent, unless this script was called with ". scriptPath/name" or "source scriptPath/name".
# https://unix.stackexchange.com/questions/27139/script-to-change-current-directory-cd-pwd
# https://stackoverflow.com/questions/874452/change-current-directory-from-a-script
# "The . will evaluate the script in the current environment, so it might be altered."
echo ""
echo "before unplugging pendrive, eject with nautilus"
I also use the following two scripts when using the watching only part on Linux Ubuntu instead of Tails, so I don't have to create two versions of each one of the previous scripts or make them more complex.
These scripts create symlinks reproducing the presence of the home and mount dirs you would have in Tails. The first script actually also copies the cleanup one into the home, because I was too often ejecting the pendrive only to remember afterwards that I should have launched the cleanup script.
BTW the cleanup script does a simple rm, but it's only the watching only part and actual files are in the pendrive. You can securely wipe files if you want instead, replacing rm with srm, nautilus calls it like this (I think you need to install the nautilus-wipe package, Secure deletion extension for Nautilus): /usr/bin/srm -v -l -r <path to the file or folder to be wiped>
fakeAmnesiaLinks_create__usingInCaseIBootedUbuntuLinux.sh
#!/bin/bash
# Launch with sudo
set -e
cd /media
mkdir amnesia
cd amnesia
ln -s /media/yourUsername/watchOnly .
cd /home
ln -s yourUsername amnesia
echo "Done. Before ejecting and unplugging pendrive, remember to run fakeAmnesiaLinks_removeWithSoftwareInHome_usingInCaseIBootedUbuntuLinux.sh"
cp -p /media/yourUsername/watchOnly/fakeAmnesiaLinks_removeWithSoftwareInHome_usingInCaseIBootedUbuntuLinux.sh /home/yourUsername/
fakeAmnesiaLinks_removeWithSoftwareInHome_usingInCaseIBootedUbuntuLinux.sh
#!/bin/bash
# Launch with sudo
set -e
cd /media
rm amnesia/watchOnly
rmdir amnesia
cd /home
rm amnesia
cd /home/yourUsername/
rm -rf Electrum-*
rm -f .electrum*
# rm fakeAmnesiaLinks_removeWithSoftwareInHome_usingInCaseIBootedUbuntuLinux.sh
rm $0
echo "Done."
Would it be easier to just have an autogen script in the github repo that creates a deb package. Then it could be submitted to debian team, or contact the tails team. Tails team require it to be part of debian ideally, but if its easy for them to just pull in a pre built deb package from this repo they might be persuaded. There is somone in one of the other issue thread who is keen on doing the debian packaging. maybe getting this deb package could be first step.
Hi @cavapoo2, I'm not sure what the process for this would be, however my configuration instructions involve some Tails-specific commands to get things going.
@JazzTp thanks for posting that info, looks like it's quite useful for easily switching out different Electrum-LTC versions. For the time being I was able to get things working using Tails dotfiles persistence (see my previous https://github.com/pooler/electrum-ltc/issues/102#issuecomment-352294460). I may revisit your info if and when I need to upgrade it. Thanks again for your time.
for easily switching out different Electrum-LTC versions
and Tails versions, which came to be very useful to me.
(I often boot from pendrive and use persistence in the offline cold storage part, but I can boot another Tails version from DVD, create symlinks and launch the version of Electrum I was using with its copy of the .electrum-ltc or .electrum folder, another advantage of not installing Electrum on Tails.
The cold storage part scripts have identical flow with appropriate paths. On the online watching only part I used to boot from DVD as I mentioned, untouchable, but the QR scan issue obliged me to use Ubuntu... BTW yesterday it was impossible to use the QRcode scanner on Ubuntu either, burnt a transaction onto CD to pass it back to the watching only part... The cold storage is running on an older Tails 2.xx, no problem with the scanner [at least on that hardware].)
@alxglover the process probably just involves emailing and generally being a PITA to debian / tails team. I think if we have the autogen (or whatever script is needed to create the deb in this repo). @ParrotSec can help. I can be a PITA with the emails to debian / tails. We also need @pooler approval.
I've wrote a simple "Installing Electrum-LTC LiteCoin wallet in Tails LiveCD operating system" howto. Can be found here: https://gist.github.com/dhlavaty/5ecaddbb761faf27417f1fccc55c4055