Installer la dernière version de rTorrent sur Debian
rTorrent est un excellent client BitTorrent en ligne de commande pouvant être géré depuis une interface Web.
Ce guide est testé sur:
- Debian 5.0 Lenny
- Debian 6.0 Squeeze
Ce guide est testé avec ces version de rTorrent:
- 0.9.2
Installation
Installez les logiciels nécessaires:
command apt-get install build-essential libssl-dev libcppunit-dev \
libsigc++-2.0-dev autogen automake libtool \ libcurl4-openssl-dev libncurses5-dev
Installation de XML-RPC for C
Le logiciel nécessite une version récente de la bibliothèque XML-RPC for C. Téléchargez les sources de la dernière version à l'aide du script sf-downloader:
command mkdir --parent '/opt/bin'
command wget 'https://raw.github.com/biapy/howto.biapy.com/master/various/sf-downloader' \
--quiet --no-check-certificate --output-document='/opt/bin/sf-downloader'
command chmod +x '/opt/bin/sf-downloader'
SOURCE="$(/opt/bin/sf-downloader --tgz xmlrpc-c xmlrpc-c-VERSION.tgz)"
Placez-vous dans le nouveau dossier:
command pushd "${SOURCE}"
Compilez la bibliothèque :
./configure command make
Installez la bibliothèque:
command make install
Supprimez les fichiers téléchargés:
command popd
command rm -r "${SOURCE}"
Installation de libTorrent
Récupérez l'URL de téléchargement de la version stable de la bibliothèque, et obtenez le numéro de version à partir de cette URL:
SOURCE_URL="$(command wget --quiet --output-document=- \
'http://libtorrent.rakshasa.no/' \ | command grep --max-count=1 'libtorrent-.*.tar.gz' \ | command sed -e 's/^.*href="\([^"]*\)".*$/\1/')" VERSION="$(echo "${SOURCE_URL}" \ | command sed -e 's/.*libtorrent-\(.*\)\.tar\.gz/\1/')"
Téléchargez l'archive contenant les sources:
command wget "${SOURCE_URL}" \
--output-document="/tmp/libtorrent-${VERSION}.tar.gz"
Décompressez l'archive:
command tar --directory "/tmp" -xzf "/tmp/libtorrent-${VERSION}.tar.gz"
Placez-vous dans le dossier obtenu:
command pushd "/tmp/libtorrent-${VERSION}"
Compilez la bibliothèque :
./autogen.sh ./configure command make
Installez la bibliothèque:
command make install
Supprimez les fichiers téléchargés:
command popd
command rm -r "/tmp/libtorrent-${VERSION}"
command rm "/tmp/libtorrent-${VERSION}.tar.gz"
Installation de rTorrent
Récupérez l'URL de téléchargement de la version stable du logiciel, et obtenez le numéro de version à partir de cette URL:
SOURCE_URL="$(command wget --quiet --output-document=- \
'http://libtorrent.rakshasa.no/' \ | command grep --max-count=1 'rtorrent-.*.tar.gz' \ | command sed -e 's/^.*href="\([^"]*\)".*$/\1/')" VERSION="$(echo "${SOURCE_URL}" \ | command sed -e 's/.*rtorrent-\(.*\)\.tar\.gz/\1/')"
Téléchargez les sources du logiciel :
command wget "${SOURCE_URL}" \
--output-document="/tmp/rtorrent-${VERSION}.tar.gz"
Décompressez l'archive:
command tar --directory "/tmp" -xzf "/tmp/rtorrent-${VERSION}.tar.gz"
Placez-vous dans le dossier ainsi créé:
command pushd "/tmp/rtorrent-${VERSION}"
Lancez la compilation:
./autogen.sh
./configure --with-xmlrpc-c
command make
Installez l'application:
command make install
Supprimez les fichiers téléchargés:
command popd
command rm -r "/tmp/rtorrent-${VERSION}"
command rm "/tmp/rtorrent-${VERSION}.tar.gz"
Mise en place du démon rTorrent
Installez les utilitaires nécessaires au démon:
command apt-get install dtach
Créez les dossiers utilisés par le démon:
command mkdir --parent "/var/lib/rtorrent/sessions" command mkdir --parent "/var/lib/rtorrent/torrents/doing" command mkdir --parent "/var/lib/rtorrent/torrents/watch" command mkdir --parent "/var/lib/rtorrent/torrents/done" command chown -R www-data:www-data "/var/lib/rtorrent"
Mettez en place le fichier de configuration du logiciel:
command wget 'https://raw.github.com/biapy/howto.biapy.com/master/various/rtorrent.rc' \
--quiet --no-check-certificate --output-document='/etc/rtorrent.rc'
Mettez en place le script init.d:
command wget 'https://raw.github.com/biapy/howto.biapy.com/master/various/rtorrent.init-d' \
--quiet --no-check-certificate --output-document='/etc/init.d/rtorrent'
command chmod +x '/etc/init.d/rtorrent'
Initialisez le journal du démon:
command touch "/var/log/rtorrent.log" command chown www-data:adm "/var/log/rtorrent.log"
Mettez en place la rotation des journaux:
command echo '# rtorrent logrotate config.
"/var/log/rtorrent.log" { weekly missingok rotate 10 compress delaycompress notifempty create sharedscripts postrotate sh -c "[ -x /etc/init.d/rtorrent ] && /etc/init.d/rtorrent restart" endscript }' > '/etc/logrotate.d/rtorrent'
Ouvrez la tranche de ports suivante sur le pare-feu pour le protocole TCP:
49160-49300
Démarrez le démon:
/etc/init.d/rtorrent start
Activez le démarrage automatique du démon:
command update-rc.d rtorrent defaults
Résolution des problèmes
Si le démon rtorrent ne se lance plus, essayez d'effacer le fichier verrou:
command rm '/var/lib/rtorrent/sessions/rtorrent.lock'
Remerciements
- Merci aux développeurs de libTorrent et rTorrent (en).
