Compile And Install Latest Transmission Version Through Debian

Transmission is a file sharing program.

When you run a torrent, its data will be made available to others by means of upload.

Any content you share is your sole responsibility.

1 - Flash Rmerlin firmware from here

2a - Install Optware-NG from here

or

2b - Install Entware-NG from here

3a - For Arm routers setup Debian Jessie from here (remove transmission if is installed: from optware with ipkg remove transmission, from entware with opkg remove transmission)

or

3b - For Mipsel routers setup Debian Wheezy from here (remove transmission if is installed: from optware with ipkg remove transmission, from entware with opkg remove transmission)

4 - Enter chrooted debian with:

debian enter

5 - Update Debian

apt update && apt upgrade

6 - Install necessary packages

apt install wget libcurl4-openssl-dev libevent-dev ca-certificates \
libssl-dev pkg-config build-essential checkinstall intltool

- Download libevent v2.0.22 source code and compile

cd /var/tmp
wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar xvf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure
make -j 2

8 - Run checkinstall, press enter, enter, type 2 and name it libevent, type 3 and give it version 2.0.22, now press enter again

checkinstall

The libevent package has been installed and saved to /var/tmp/libevent-2.0.22-stable/libevent_2.0.22-1.deb, you can store it in another place for future use or share it with someone else.

8b - If you get "Installation failed. Aborting package creation", disable translation and run checkinstall again

sed -i 's/TRANSLATE=1/TRANSLATE=0/g' "/etc/checkinstallrc"

9 - Download and install transmission v2.92+ latest source code

cd /var/tmp
wget https://build.transmissionbt.com/job/trunk-linux/lastSuccessfulBuild/artifact/transmission-trunk-r14720.tar.xz
tar xvf transmission-trunk-r14720.tar.xz
cd transmission-2.92+
./configure --enable-lightweight
make -j 2

10 - Run checkinstall and press enter 3 times

checkinstall

The transmission package has been installed and saved to /var/tmp/transmission-2.92+/transmission_2.92+.deb, you can store it in another place for future use or share it with someone else.

10b - If you get "Installation failed. Aborting package creation", disable translation and run checkinstall again

sed -i 's/TRANSLATE=1/TRANSLATE=0/g' "/etc/checkinstallrc"

11 - Download startup script

wget -c -O /etc/init.d/S95transmission-debian http://goo.gl/CTncEk
chmod 755 /etc/init.d/S95transmission-debian

12 - Start and stop transmission to create path

/etc/init.d/S95transmission-debian start
/etc/init.d/S95transmission-debian stop

13 - Backup and replace settings file with optimised one

mv /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.backup
wget -c -O /etc/transmission-daemon/settings.json http://goo.gl/Wti8e9

14 - Start transmission

/etc/init.d/S95transmission-debian start

15 - Go to default router ip address 192.168.1.1:9091 username admin, password admin, you can change this by editing /etc/transmission-daemon/settings.json file but be sure transmission is stopped before making changes.

16 - To create startup script we need to stop transmission, and exit debian

/etc/init.d/S95transmission-debian stop
exit

17 - Add transmission to chroted services list

echo "" >>/opt/etc/chroot-services.list
echo "S95transmission-debian" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list

18 - Create init-start script for some memory tweaks as suggested by ryzhov_al

nano /jffs/scripts/init-start

#!/bin/sh
echo 524288 > /proc/sys/net/core/rmem_max
echo 524288 > /proc/sys/net/core/wmem_max
echo 8192 > /proc/sys/vm/min_free_kbytes

Save with CTRL-O, press ENTER and exit nano with CTRL-X

Make scripts executable

chmod a+rx /jffs/scripts/*

19 - Start transmission from outside debian together with mounted external folder

debian restart

Enjoy...

  • Kerkung

    root@RT-AC88U-B020:/# /etc/transmission-daemon/settings.json
    bash: /etc/transmission-daemon/settings.json: Permission denied

    i can't setting, and nothing happened when connect to 192.168.1.1:9091

    Can you guide me plz?

    • Why bash?
      nano /etc/transmission-daemon/settings.json

      • Kerkung

        oh sry I forget to fill nano :D.

        Next question why I cant connect to 192.168.1.1:9091

        (/opt/share/transmission/web/index.html (No such file or directory)

      • You mixed some things, if you are inside Debian, don't have to put /opt prefix

  • Al

    Hi,

    Thanks for useful HQT. One generic asus router question :

    I have installed transmission and it works fine, when I use asus as the only router. However, now I connect asus router as a secondary router cascaded (lan to lan) to my ISP's router, that means that the asus router recieves the internet connection not from WAN but from LAN. Internet goes fine for all clients connected to asus router. But it seems that asus router itself cannot get internet connection, say for the purposes of the transmissionbt. In this set up, even asus' Download Master does not works (it does not launch even).

    Can you please tell me, what shall I adjust within the asus router in order to get the transmission working, when internet connection incomes from LAN port.

    Thank you!

  • Ven Tri

    still cannot open download folder from the transmission gui [code]Stopping chroot'ed Debian services...
    /etc/init.d/samba-mount: 19: /etc/init.d/samba-mount: Syntax error: ")" unexpected (expecting "}")
    Stopping bittorrent client transmission-daemon...
    Stopping bittorrent client transmission-daemon succeeded
    umount: can't forcibly umount /tmp/mnt/sda5/optware-ng.arm/debian/dev/pts: No such file or directory
    Restarting chroot'ed Debian services...
    /etc/init.d/samba-mount: 19: /etc/init.d/samba-mount: Syntax error: ")" unexpected (expecting "}")

    [/code]

    Strijem

  • Greetings and thank you for this wonderful job! I am very pleased but I want it even better..

    Could you tell me please how to set different download directory which is outside the debian.. \AC87Uoptware-ng.arm (at sda5)debianmntTorrent Downloads

    Whatever dir I set, right button open containing folder does not work.. which is my fav ;))

    Thank you very much

    • External directory is mounted inside chrooted debian as /mnt
      Example, if you want to mount /mnt/sda5/TorrentDownloads inside debian
      EXT_DIR=/tmp/mnt/sda5/TorrentDownloads/
      After restarting debian you should see files inside debian /mnt/

      • Strijem

        Yes, I see them, thanks! How to make open location folder button make work? I am currently downloading here \AC87Uoptware-ng.arm (at sda5)debianmntDownloads or /mnt/Downloads/

        I have added these to path section but with no luck.. any idea please how should it look? :))

        /tmp/mnt/sda5/Downloads/
        /mnt/Downloads/
        /tmp/mnt/Downloads/

      • You can't browse to location folder, need to manually specify the path
        Remove /tmp from path
        After starting debian, create folder
        mkdir -p /opt/debian/mnt/Downloads
        In transmission webui, set path as /mnt/Downloads

        If is not working, post here output from:
        cat /opt/etc/init.d/S99debian
        mount
        ls /mnt/sda5

      • Ven Tri

        [code]str@AC87U:/tmp/home/root# cat /opt/etc/init.d/S99debian
        #!/bin/sh
        PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
        # Folder with Debian Jessie
        CHROOT_DIR=/tmp/mnt/sda5/optware-ng.arm/debian
        # Some folder outside of sandbox,
        # will be mounted to /mnt folder in Debian
        # Uncommented next line if you need to mount a folder inside debian
        # EXT_DIR=/tmp/mnt/sda5/Torrent Downloads/
        CHROOT_SERVICES_LIST=/opt/etc/chroot-services.list
        if [ ! -e "$CHROOT_SERVICES_LIST" ]; then
        echo "Please, define Debian services to start in
        $CHROOT_SERVICES_LIST first!"
        echo "One service per line. Hint: this is a script names from
        Debian's /etc/init.d/"
        exit 1
        fi
        MountedDirCount="$(mount | grep $CHROOT_DIR | wc -l)"
        start() {
        if [ $MountedDirCount -gt 0 ]; then
        echo "Chroot'ed services seems to be already started,
        exiting..."
        exit 1
        fi
        echo "Starting chroot'ed Debian services..."
        for dir in dev proc sys; do
        mount -o bind /$dir $CHROOT_DIR/$dir
        done
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item start
        done
        }
        stop() {
        if [ $MountedDirCount -eq 0 ]; then
        echo "Chroot'ed services seems to be already stopped,
        exiting..."
        exit 1
        fi
        echo "Stopping chroot'ed Debian services..."
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item stop
        sleep 2
        done
        mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l
        }
        restart() {
        if [ $MountedDirCount -eq 0 ]; then
        echo "Chroot'ed services seems to be already stopped"
        start
        else
        echo "Stopping chroot'ed Debian services..."
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item stop
        sleep 2
        done
        mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l
        echo "Restarting chroot'ed Debian services..."
        for dir in dev proc sys; do
        mount -o bind /$dir $CHROOT_DIR/$dir
        done
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item start
        done
        fi
        }
        enter() {
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        mount -o bind /dev/ /opt/debian/dev/
        mount -o bind /dev/pts /opt/debian/dev/pts
        mount -o bind /proc/ /opt/debian/proc/
        mount -o bind /sys/ /opt/debian/sys/
        chroot /opt/debian /bin/bash
        }
        status() {
        if [ $MountedDirCount -gt 0 ]; then
        echo "Chroot'ed services running..."
        else
        echo "Chroot'ed services not running!"
        fi
        }
        case "$1" in
        start)
        start
        ;;
        stop)
        stop
        ;;
        restart)
        restart
        ;;
        enter)
        enter
        ;;
        status) status
        ;;
        *)
        echo "Usage: (start|stop|restart|enter|status)"
        exit 1
        ;;
        esac
        echo Done.
        exit 0[/code]

        Here it is. I have added in path directory various combinations none with success. /mnt/Downloads/ start with.. :( Thanks for cooperation

      • TeHashX

        :)
        Uncomment line with external folder
        From
        # EXT_DIR=/tmp/mnt/sda5/Torrent Downloads/
        To
        EXT_DIR=/tmp/mnt/sda5/Torrent Downloads/

      • TeHashX

        And don't leave spaces in folder or file names
        Torrent Downloads - not ok
        TorrentDownloads - 👌

  • Toufiq Ibna Mustafiz

    root@RT-AC87U-37F8:/var/tmp# wget https://build.transmissionbt.com/job/trunk-linux/lastSuccessfulBuild/artifact/transmission-trunk-r14720.tar.xz
    converted 'https://build.transmissionbt.com/job/trunk-linux/lastSuccessfulBuild/artifact/transmission-trunk-r14720.tar.xz' (ANSI_X3.4-1968) -> 'https://build.transmissionbt.com/job/trunk-linux/lastSuccessfulBuild/artifact/transmission-trunk-r14720.tar.xz' (UTF-8)
    --2016-10-12 11:46:45-- https://build.transmissionbt.com/job/trunk-linux/lastSuccessfulBuild/artifact/transmission-trunk-r14720.tar.xz
    Resolving build.transmissionbt.com (build.transmissionbt.com)... 104.18.53.125, 104.18.52.125, 2400:cb00:2048:1::6812:347d, ...
    Connecting to build.transmissionbt.com (build.transmissionbt.com)|104.18.53.125|:443... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2016-10-12 11:46:47 ERROR 404: Not Found.

  • Yukovlav

    Hello, thanks for the great tutorial, but one important step is missing (for me anyway):
    How can I chnagne the download directory beyond the optware-ng/debian folder? Any changes I make just keep the download folder inside optware-ng/debian. I want to be able to change between HDD's (sda1, sdb1) and have them download inside the root folder. How is this possible?

    • TeHashX

      cd to partition where you want to install debian, like
      cd /mnt/sda1
      wget -c -O debian_jessie8.3-arm_clean.tgz http://goo.gl/acr5XU
      tar -xvzf ./debian_jessie8.3-arm_clean.tgz
      Then set the debian path in /opt/etc/init.d/S99debian script to /mnt/sda1/debian (should be more debian path in that script...)

      • Yukovlav

        But is it possible to change the setting.json of transmission to go higher than the debian folder? Instead of installing debian elsewhere?
        For example make the final download folder the root folder of sdb1.
        Make it sdb1/Transmission not sdb1/optware-ng/debian/mnt/Transmission?

      • TeHashX

        Yes, in S99debian set EXT_DIR to /mnt/sdb1/Transmission
        In debian settings.json set download-dir to /mnt

      • Yukovlav

        Ill try it later on tonight! Thank you!

      • Yukovlav

        It works as long as you dont forget debian stop and start. Thanks!

    • Nikitossss

      Also greatly thankful for this cool tutorial! But I also have such a problem as Yukovlav described, and I didn't manage to solve it. So,

      I have 2 drives connected to router: main (sda1) used as file storage and secondary (sba1) on which optware-ng and debian with transmission installed. So how do I download files via transmission on sda1, instead of sba1. Now files are downloading in any case inside optware-ng folder on sba1. Tried to change folders in S99debian and settings.json but nothing happens, files are still downloading on sba1.

      Thx a lot

      • TeHashX

        EXT_DIR should be /mnt/sda1/Media/
        download path in settings.json should be /mnt or /mnt/transmission
        Don.t forget to exit debian and restart so external folder be mounted.
        I have to modify the S99debian script to mount ext_dir even if you enter debian not just start

      • Nikitossss

        Still no luck =( It downloads file here anyway

        /sdb1/optware-ng.arm/debian/mnt/transmission

        Changed EXT_DIR to /mnt/sda1/Media/ as you said and did everything else a couple of times. Can't force it to download on other hard drive (sda1).

      • TeHashX

        Did you stop transmission while editing settings.json file?

      • Nikitossss

        Yes, even double checked it after

      • TeHashX

        Post here:
        S99debian script
        settings.json
        Output from:
        mount
        df
        free

  • Kev

    Hey, this is great - seems like 2.92 is out. How can we update to that version without going through to the debian version? Also, is there any tutorial to place transmission behind VPN on the router? Thank you!

SoftEther VPN Running on AsusWRT Routers
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Nginx Web Server with PHP Support through Optware-NG
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Spreed WebRTC server and web client
Asterisk VoIP Server running on AsusWRT Routers
SoftEther VPN Running on AsusWRT Routers
NZBGet through Entware
Minidlna UPnP Media Server through Debian Jessie Arm
NetData System Monitor Entware

SUBSCRIBE

To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...