rtorrent 11 on Debian 5
- December 1st, 2009
- Posted in Linux . Modding
- By jzerbe
- Write comment
For those of you looking for DHT support with the default rtorrent package that it is in the Debian 5 apt repos you are out of luck. Currently the only way to get DHT support for rtorrent is to use the 0.8.5-2 release for Debian “Squeeze” (testing).
So to get rtorrent working with DHT, go about the installation like you would usually:
apt-get update (should leave dependencies installed)
apt-get upgrade
apt-get -y install rtorrent
apt-get remove rtorrent libtorrent10
wget http://ftp.us.debian.org/debian/pool/main/r/rtorrent/rtorrent_0.8.5-2_i386.deb (for i386)
wget http://ftp.us.debian.org/debian/pool/main/libt/libtorrent/libtorrent11_0.12.5-2_i386.deb (for i386)
dpkg -i libtorrent11_0.12.5-2_i386.deb
dpkg -i rtorrent_0.8.5-2_i386.deb
Your version of rtorrent, should now have DHT and PEX support.
For automatically starting rtorrent, you can download an init script from the libtorrent project, that works real great.
wget http://libtorrent.rakshasa.no/raw-attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh
mv rtorrentInit.sh /etc/init.d/rtorrent
chmod +x /etc/init.d/rtorrent
vi /etc/init.d/rtorrent (change the user in the config file to a different user account, your own? that has a .rtorrent.rc in it’s home directory –> /home/[user]/.rtorrent.rc)
vi /etc/rc.local < — stick in the line “/etc/init.d/rtorrent start” before the “exit 0″
Make a .rtorrent.rc startup file, so that /etc/init.d/rtorrent works properly
wget http://vraidsys.com/tutorials/rtorrent.rc
mv rtorrent.rc /home/[user]/.rtorrent.rc
vi /home/[user]/.rtorrent.rc (change user to the user you want this to run as)
mkdir -p /home/[user]/torrents/session
chown [user] /home/[user]/.rtorrent.rc <-- run this if doing everything from the root user
chmod -R 777 /home/[user]/torrents <-- I do this so that I can access my torrents from several user accounts. see comments section. [Edit 1/1/2010]
Now restart the machine: shutdown -r now
When you log back in, torrents should be automatically downloaded to the /home/[user]/torrents/ directory, when you stick .torrent files in the /home/[user]/torrents/ directory. You can also access the screen thread by screen -r rtorrent in a terminal session.
In addition to DHT, if you want magnet links support there is a patch available at http://libtorrent.rakshasa.no/ticket/955 which adds support for it. Of course this does mean compiling a local version not just using the squeeze package. I’ve recently written a short guide to packaging new versions of apps for local use on my blog if you want to have a go.
The debian packaging for rtorrent is rather weird making this a bit more of a chore than it needs to be. Rather than containing the source directly, the tarball contains another tarball which has the source. So you need to untar twice, patch the code then tar the changed source back up again twice.
Hopefully the patch will be added to the main codebase soon and these contortions won’t be necessary.
@Ghworg Yeah I noticed the double tarball packaging, when I was playing with the source earlier. Just might have to take you up on that and compile from source one of these days.
Worked flawlessly on my Ubuntu 9.04 (Crunchbang)… thanks for the cut and pasteable instructions. Whew.
the 777 above introduces a huge vulnerability… particularly risky if you’re running torrent!
@jamie Point taken. True, you probably shouldn’t 777 the whole directory, I just access my torrents via a web frontend that runs as the www-data user, as well as from several other user accounts.