Installation Guide

This chapter presents you with different installation options. If you start with an unconfigured host, consider using the automated setup provided by the pimp-my-box project, which will install all you need for a fully working torrenting setup including a default configuration.

As you can see, installing the software package itself can be done in two ways, choose one of them. Afterwards, the freshly installed software must be provided with a configuration, as described in the Configuration Guide.

Note

Unless otherwise indicated by using sudo or mentioning it in the text, installation commands should not be run as root, but in your normal user account, or else one you specifically created for installing rTorrent and pyrocore.

When commands and their output are both contained in a code box, $ represents the command prompt of your shell, followed by the command you are supposed to enter. Do not enter the leading $!

Warning

The syntax of XMLRPC commands changed with rTorrent version 0.8.9, and continues to change. Make sure that the versions of rTorrent and PyroScope you plan to install or update to are actually compatible. There are compensation mechanisms in both projects, but there are limits to those — scan the respective changelogs for breaking changes.

pyrocore 0.5+ will no longer support the old syntax, and thus not work with rTorrent 0.8.x versions. rTorrent 0.9.6 has the old commands disabled by default, and only a special command line switch will enable them again, for now. Also, this documentation uses the new syntax (mostly).

Preparing Your Host

Installing Dependency Packages

Before installing pyrocore, some software packages need to be available on your machine, Python 2 among them.

On Debian-type systems (Debian, Ubuntu, Raspbian, …), the following ensures you have everything you need, including packages necessary for installing from source:

sudo apt-get install python python-dev python-virtualenv python-pip \
    python-setuptools python-pkg-resources git build-essential

On other Linux distributions, see the following section for further hints.

If you want to install everything in a dedicated user account, e.g. for security reasons, this will create a rtorrent user when entered into a root shell:

groupadd rtorrent
useradd -g rtorrent -G rtorrent,users -c "Torrent User" -s /bin/bash --create-home rtorrent
chmod 750 ~rtorrent
su - rtorrent -c "mkdir -p ~/bin"

Using such a dedicated account also makes sure you don’t need to have fear this software does anything malicious — if it did, it’d be contained in that account. It also makes deinstallation or start-from-zero way less of a hassle.

Installing Python2

For Debian and derivatives, the apt-get command in the previous section already took care of everything.

Other Linux distributions usually come equipped with a Python 2.7 interpreter, but on very new releases, Python 3 may be the default and Python 2.7 just an option. In case you need to install Python 2, refer to Installing Python on Linux and consider using pyenv.

The following shows how you can check what version you have as the default (the sample output is from Ubuntu 15.04):

$ /usr/bin/python --version
Python 2.7.9

Try calling /usr/bin/python2 in case the above shows a 3.* version.

Installing the pyrocore Package

Installing the software package itself can be done in two ways, choose one of them.

Warning

If you want to switch over from an old installation to one in ~/.local, then move that old directory away, before installation! Like this:

( cd ~/lib && mv pyroscope pyroscope-$(date +'%Y-%m-%d').bak )

Your existing configuration and data is not affected by this, but make sure you read the migration instructions in Software Updates.

Option 1: Installing from GitHub

The recommended way to install this software is directly from its GitHub repository. To do that, use the following commands:

mkdir -p ~/bin ~/.local
git clone "https://github.com/pyroscope/pyrocore.git" ~/.local/pyroscope

# Pass "/usr/bin/python2", or whatever else fits, to the script as its
# 1st argument, if the default of "/usr/bin/python" is not a suitable
# version.
~/.local/pyroscope/update-to-head.sh

# Check success
pyroadmin --version  # call "exec $SHELL -l" if this fails, and retry

You can choose a different install directory, just change the paths accordingly. If then anything fails, stop changing things and stick to the trodden path.

If you previously had no ~/bin directory, call exec $SHELL -l to register it in the PATH of your current terminal session – especially if you see an error message like pyroadmin: command not found.

If everything went OK, continue with the Configuration Guide.

Option 2: Installing from PyPI

If you chose to install a release version from the Python package repository (PyPI), the most simple but not best way is calling pip install --user -U pyrocore, and make sure $HOME/.local/bin is in your $PATH. This way is OK if you just want to use the tools for metafile handling, i.e. mktor, chtor, and lstor, but not the rTorrent tools.

The recommended way using a dedicated virtualenv goes like this:

mkdir -p ~/bin ~/.local
/usr/bin/virtualenv --no-site-packages $_/pyroscope
cd $_
ln -nfs python bin/python-pyrocore
ln -nfs $PWD/bin/python-pyrocore ~/bin
. bin/activate
xargs -n1 pip install -U <<<"pip setuptools wheel"
pip uninstall -y distribute 2>/dev/null
pip install -U "pyrocore[templating]"
ln -nfs $(egrep -l '(from.pyrocore.scripts|entry_point.*pyrocore.*console_scripts)' $PWD/bin/*) ~/bin

# Check success
pyroadmin --version  # call "exec $SHELL -l" if this fails, and retry

If you previously had no ~/bin directory, call exec $SHELL -l to register it in the PATH of your current terminal session – especially if you see an error message like pyroadmin: command not found.

If everything went OK, continue with the Configuration Guide.