[guide] How to install Transmission 2.1 with yum on CentOS 5

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
lollerskates
Posts: 12
Joined: Tue Feb 23, 2010 6:15 pm

[guide] How to install Transmission 2.1 with yum on CentOS 5

Post by lollerskates »

The title is a bit deceiving, but this is an extremely simple way to install Transmission where most of the packages needed for compiling are done through yum. The "how to build" documentation here is very outdated / annoyingly unfinished. I don't know who maintains that page, but it would be great if it could be replaced :roll:

Install dependencies and some tools we will use:

Code: Select all

yum -y install openssl-devel curl-devel libevent-devel intltool.i386 gettext wget nano
Get and unpack transmission (warning, current version 2.12 is in these filenames)

Code: Select all

wget http://download.transmissionbt.com/files/transmission-2.12.tar.bz2
tar xjvf transmission-2.12.tar.bz2
cd transmission-2.12
Try to build transmission and make after this

Code: Select all

./configure
Did you get errors? Try installing a couple more things and configure again...

Code: Select all

yum -y groupinstall "Development Tools"
./configure
Now make...

Code: Select all

make && make install
Done?! WOW! Now we run it once to create the settings.json in ~ (home directory)

Code: Select all

transmission-daemon
And then kill it.. appending -HUP to force dump the settings

Code: Select all

killall -HUP transmission-daemon
OK now let's edit the settings (to your liking) and don't forget to save (CTRL+X Y)

Code: Select all

cd ~
nano .config/transmission-daemon/settings.json
And finally re-run transmission-daemon. It only needs to be run once and then you can access the web interface on the port you setup.

Code: Select all

transmission-daemon
If anyone has anything easier for CentOS, please feel free to share. This is as easy as I could get it :mrgreen:
Last edited by lollerskates on Tue Apr 26, 2011 9:41 pm, edited 1 time in total.
jambuttons
Posts: 3
Joined: Thu Oct 14, 2010 4:07 pm

Re: [ez guide] How to install Transmission with yum on CentO

Post by jambuttons »

My server just trashed my Centos install, so I had to do it all again. Here are my cheat notes from struggling for a couple of hours last night.
Keywords for google: installing transmission torrent on Centos headless server web interface (for dummies).

I'll get two things out of the way, because they are the most important frustrations. First is the daemon execution script.
This is different for Centos/Redhat because they don't have the start-stop-daemon function.
You will notice that I've commented out a few DAEMON-ARGS , which didn't work for me.
The smaller one with "-T and --blocklist" will force Transmission to start the web interface with no password, and force "rpc-authentication-required": false, this is terribly annoying.
It appears best to start Transmission using no args, and then then the settings.json appears in /home/transmission/.config/transmission, after you've run it, and stopped it.
If you are terribly stuck, you can start transmission-daemon as root (using no script), and then everything, including settings.json appears in root home.

The transmission-daemon script for /etc/init.d/

Code: Select all

#!/bin/bash
#
# chkconfig: - 16 84
# description: Start up transmission-daemon
#
# processname: transmission-daemon
# config: /etc/sysconfig/transmission

# source function library
. /etc/rc.d/init.d/functions

# Get network config
. /etc/sysconfig/network

[ "${NETWORKING}" = "no" ] && exit 0

# Defaults
TRANSMISSION_HOME=/var/lib/transmission

DAEMON_USER="transmission"
#DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"
#DAEMON_ARGS="-T --blocklist "
DAEMON_ARGS=""

# Daemon
NAME=transmission-daemon
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DAEMON=$(which $NAME)
DAEMON_PIDFILE=/var/run/$NAME.pid
DAEMON_LOCKFILE=/var/lock/subsys/$NAME
DAEMON_SCRIPTNAME=/etc/init.d/$NAME
DAEMON_LOGFILE=/var/log/$NAME.log

[ -x "$DAEMON" ] || exit 0

start() {
    echo -n $"Starting ${NAME}: "
    
    if [ -n "$TRANSMISSION_HOME" ]; then
        export TRANSMISSION_HOME
    fi

    su - $DAEMON_USER -c "$DAEMON $DAEMON_ARGS"

    sleep 2

    status $NAME &> /dev/null && echo_success || echo_failure
    RETVAL=$?

    if [ $RETVAL -eq 0 ]; then
        touch $DAEMON_LOCKFILE
        pidof -o %PPID -x $NAME > $DAEMON_PIDFILE
    fi

    echo
}

stop() {
    echo -n $"Shutting down ${NAME}: "
    
    killproc $NAME
    RETVAL=$?

    [ $RETVAL -eq 0 ] && /bin/rm -f $DAEMON_LOCKFILE $DAEMON_PIDFILE

    echo
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        stop
        start
    ;;
    status)
        status $NAME
    ;;

    *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2
        exit 3
    ;;
esac

Something important for converting Centos to a real OS, is connecting it to a real repository. I found the default repository has nothing in it, so yum never finds any useful packages.

Code: Select all

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Once you have connected to the real world, you can start to gear-up with real software.

yum update -y (this will install about 100MB of updates, and make you feel like you have done something. Surprisingly, you have.)
yum install the following :

libevent-devel
nano
intltool
curl
curl-devel
gcc
gcc-c++
m4
make
automake
libtool
gettext
openssl-devel
pkgconfig

Prior to the make, the environment has to be told where pkgconfig is. pkgconfig ends up in /usr/lib/pkgconfig for Centos; different places in other distribs

export PKG_CONFIG_PATH=/usr/lib/pkgconfig

create a source directory for Transmission : mkdir /usr/src/transmission, go there : cd /usr/src/trans*
get a decent version of Transmission

Code: Select all

wget http://download.m0k.org/transmission/files/transmission-2.13.tar.bz2
extract it, change to it, then hopefully make it:

tar xvjf transmission-2.13.tar.bz2
cd transmission-2.13
./configure -q && make -s
make install


Starting it up. The daemon script will start Transmission as user "transmission". This user needs a /home so that transmission can work in it. No password needs to be set.

adduser transmission

Put the script I supplied up top into a file : /etc/init.d/transmission-daemon, using nano editor. Make sure the nano SSH window is very wide before pasting into it, or lines will be cut.
make sure the script is executable:
chmod +x transmission-daemon

Start and stop the service to create the Transmission settings file settings.json
service transmission-daemon start
service transmission-daemon stop


Go to the transmission config directory
cd /ho*/tr*/.c*/t*

edit the file settings.json ( nano se* )
mess with the following values : (at the very least)

"rpc-authentication-required": true,
"rpc-enabled": true,
"rpc-password": "mypassword",
"rpc-username": "mysuperlogin",
"rpc-whitelist-enabled": false,


Start the service again, and check if it's working on your server on port :9091

If it's not working, I don't know what the hell's wrong. honestly ;-)
ranpha
Posts: 8
Joined: Sat Mar 05, 2011 10:33 am

Re: [ez guide] How to install Transmission with yum on CentO

Post by ranpha »

With 2.2x versions, you will need updated libevent-devel that isn't available even from RPMForge, therefor this guide is usable for transmission builds 2.1x and older.
Post Reply