Wednesday, June 29, 2011

How To Install libTorrent and rTorrent on Centos 5.6

rTorrent is my favorite Bittorrent client when I'm on a linux machine. It's lightweight, fast and easy to use (while some people will disagree about that). For this setup, I'll be using a Xen VPS (100mb RAM and 10gb disk) with Centos 5.6 x86 installed. Although I am using Centos, this setup will work flawlessly on Fedora, Amazon (tested) and other Red Hat systems. So, as long as you have an rpm based distro, you can follow this guide.

First make sure that your system is up to date by doing:
yum update

Now, we need to install some development tools and libraries that we will need to compile our software.

yum groupinstall "Development Tools"
yum groupinstall "Development Libraries"

Now that we have most of the require tools, we'll install the EPEL repository to make it easy for us to get the additional tools. Take a look at to find more information or if you are using x64 system.
cd /tmp
rpm -Uvh epel-release-5-4.noarch.rpm
yum update

We can now install the required additional software:
yum install cppunit cppunit-devel libsigc++20 libsigc++20-devel

We now have all the software we need to compile libTorrent and rTorrent, so, let's get started:

**** Always check for latest version on

We can't compile libTorrent 0.12.9 and rTorrent 0.8.9 on Centos yet because many of the libraries required by rTorrent is outdated on Centos. This would require much messing around with the OS to be able to get the up-to-date versions. Since there is a high probability that we will break the OS by doing this, we'll just stick to stable libTorrent 0.12.6 and rTorrent 0.8.6 for now.

cd /usr/local/src
tar -zxvf libtorrent-0.12.6.tar.gz
tar -zxvf rtorrent-0.8.6.tar.gz
cd libtorrent-0.12.9
rm -f scripts/{libtool,lt*}.m4
make install
cd ..
SUMMARY = We downloaded the archives, extracted them, deleted some unwanted scripts and compiled.

Now, rTorrent:
cd rtorrent-0.8.6
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
rm -f scripts/{libtool,lt*}.m4
make install
cp doc/rtorrent.rc ~/

We now have libTorrent and rTorrent installed on the system. Let's grab the sample configuration file:
cd ~/
nano rtorrent.rc

Edit as you like. See the website for details. I usually just edit the speeds and peers settings. I limit the upload and download speeds to 1000kb/s, uncomment peers lines, set max uploads to 4, change download directory, enable ratio handling and leave the rest. Now, we rename it to .rtorrent.rc
mv rtorrent.rc .rtorrent.rc

We must now install GNU Screen so that we can leave rTorrent running even with our terminal closed.
yum install screen

We can now fire up rtorrent:
screen /usr/local/bin/rtorrent

Press backspace and paste the location of a .torrent file to give it a try. Then you can just close the window and let the thing download.

Read the User Guide for instructions.

That's all there is to compiling those software, hope it worked out for you! If you're getting some weird errors, just leave a comment and I shall give you a solution.

No comments:

Post a Comment