I previously wrote how you can install Truffle & TestRPC on a windows machine, by using the Windows installers for Node & npm.
However I have found it is a much nicer experience to use the Windows Subsystem for Linux which provides a native Ubuntu shell with bash, which allows me to run all the Linux tools natively without issues. These install steps will work on an Ubuntu machine as well.
Prerequisite if running on Windows
- Enable Windows subsystem for Linux.
Follow this short guide on how to enable it https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
- After following the steps in the guide above. Simply start the Ubuntu bash shell
# Takes a clean Ubuntu image, up to being dev ready.
# install npm from official repo, as apt-get has a very old version of npm
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash –
sudo apt-get update -y && sudo apt-get upgrade -y
# install the basics
sudo apt-get install -y build-essential python nodejs
# upgrade npm before install tools
sudo npm install -g npm
sudo npm install -g ethereumjs-testrpc truffle
Additional things to do
Now that your machine has it installed, I recommend you follow my other guide to get Visual Studio code configured for Truffle development.