0

How do I compile transmission-gtk torrent client from source on Linux Mint 18 or generally Ubuntu 16.04 based systems?

Supposing I want to:

  1. Remove the original packaged version.
  2. Replace it, while retaining the original settings, desktop item, etc.
0

In this compilation procedure, let it be clear, that it is written for today's current version 2.92, and for Ubuntu 16.04 based systems as is Linux Mint 18. This guide may differ slightly on later versions of systems and / or Transmission.

  1. Go to the official page; over secure protocol, currently the official page does not redirect to HTTPS; you may use the link below to get to the web page:

    https://transmissionbt.com/download/

  2. Navigate to Source Code section and download the current one; it uses GitHub repository; if you are in CLI, you may use this direct method:

    wget --continue https://github.com/transmission/transmission-releases/raw/master/transmission-2.92.tar.xz
    
  3. Check the SHA-256 hash matches; it is written on the official download page; for version 2.92 the following applies:

    sha256sum --binary transmission-2.92.tar.xz
    
    3a8d045c306ad9acb7bf81126939b9594553a388482efa0ec1bfb67b22acd35f
    
  4. Extract the archive:

    tar -xJvf transmission-2.92.tar.xz
    
  5. Go to the extraction directory:

    cd transmission-2.92/
    
  6. Now we need to install the build dependencies for transmission-gtk:

    sudo apt-get build-dep transmission-gtk
    
  7. Let's make sure all of the prerequisites are installed, according to this GitHub page:

    sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev libglib2.0-dev libevent-dev libminiupnpc-dev libappindicator-dev
    

    Note, that I must have removed libminiupnpc5 as libminiupnpc-dev replaces it.

  8. Run the configuration script:

    ./configure
    

    The following optional arguments may be passed to the configuration script (copy-pasted from the configuration script):

    Optional Features:
    --disable-option-checking  ignore unrecognized --enable/--with options
    --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
    --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
    --enable-silent-rules   less verbose build output (undo: "make V=1")
    --disable-silent-rules  verbose build output (undo: "make V=0")
    --enable-shared[=PKGS]  build shared libraries [default=yes]
    --enable-static[=PKGS]  build static libraries [default=yes]
    --enable-fast-install[=PKGS]
                            optimize for fast installation [default=yes]
    --enable-dependency-tracking
                            do not reject slow dependency extractors
    --disable-dependency-tracking
                            speeds up one-time build
    --disable-libtool-lock  avoid locking (might break parallel builds)
    --disable-largefile     omit support for large files
    --enable-external-dht   Use system external-dht
    --enable-external-b64   Use system libb64
    --enable-utp            build µTP support
    --enable-external-natpmp
                            Use system external-natpmp
    --enable-nls            enable native language support
    --disable-nls           do not use Native Language Support
    --enable-lightweight    optimize libtransmission for low-resource systems:
                            smaller cache size, prefer unencrypted peer
                            connections, etc.
    --enable-cli            build command-line client
    --enable-mac            build Mac client
    --enable-daemon         build daemon
    
    Optional Packages:
    --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                      both]
    --with-aix-soname=aix|svr4|both
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
    --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                            compiler's sysroot if not specified).
    --with-crypto=PKG       Use specified crypto library: auto (default),
                            openssl, cyassl, polarssl
    --with-inotify          Enable inotify support (default=auto)
    --with-kqueue           Enable kqueue support (default=auto)
    --with-systemd-daemon   Add support for systemd startup notification
                            (default is autodetected)
    --with-gtk              with Gtk
    
  9. Check if the output of the configuration script matches the following (if that is what you want):

    Configuration:
    
       Source code location:                              .
       Compiler:                                          g++
    
       Build libtransmission:                             yes
          * optimized for low-resource systems:           no
          * µTP enabled:                                  yes
          * crypto library:                               openssl
    
       Build Command-Line client:                         no
    
       Build GTK+ client:                                 yes
          * libappindicator for an Ubuntu-style tray:     yes
    
       Build Daemon:                                      yes
    
       Build Mac client:                                  no
    

    If there is nothing wrong, you may proceed, otherwise you would need to troubleshoot the problem.

  10. Compile the program, this may take a while:

    make
    

    If the compilation is successful, you may proceed, otherwise you would need to troubleshoot the problem.

  11. Before you install it, you will probably want to remove the rather old stable version you may have installed from the repository, but there is a hatch: You will probably want to keep your settings, and if so, locate the settings file:

    locate transmission/settings.json
    
  12. Let's suppose it is in your personal ~/.config/ directory. Make a backup somewhere, e.g. into your home directory:

    cp ~/.config/transmission/settings.json ~/
    
  13. Now remove the original packaged version:

    sudo apt-get purge transmission-gtk transmission-common
    
  14. Install your compiled transmission-gtk client:

    sudo make install
    
  15. While not having the transmission-gtk client started, you may move your settings file in place, or better first examine the differences, and then decide, if just overwriting it would be OK or not:

    mv ~/settings.json ~/.config/transmission/settings.json
    
  16. Finally supposing you want a desktop item, then copy it and mark it as executable:

    cp ~/Downloads/transmission-2.92/gtk/transmission-gtk.desktop ~/Desktop/
    
    chmod a+x ~/Desktop/transmission-gtk.desktop
    
  17. Similarly, you may create a menu item, you just need to add sudo and don't bother with the execution bit:

    sudo cp ~/Downloads/transmission-2.92/gtk/transmission-gtk.desktop /usr/share/applications/
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.