how to install both versions of deluge client?

General support for problems installing or using Deluge
Post Reply
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

how to install both versions of deluge client?

Post by iconoclasthero »

Is it possible to run both the old and new versions of the deluge client (deluge-gtk) on two client machines such that each client could connect to deluged servers of different [incompatible] versions running on separate machines? I have one client with the old and one with the new version. The servers are fine the way they are. alias ver='lsb_release -a'

Servers:
Server one:

Code: Select all

$ deluged --version
deluged 2.0.3-2-201906121747-ubuntu18.04.1
libtorrent: 1.1.5.0
Python: 3.6.8
OS: Linux 4.15.0-65-generic
$ ver
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
$ python2 --version
Python 2.7.15+
$ python3 --version
Python 3.6.8
Server two:

Code: Select all

$ deluged --version
deluged: 1.3.15
libtorrent: 1.1.1.0
$ ver
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
$ python2 --version
Python 2.7.15+
$ python3 --version
Python 3.6.8
Clients:
Client one:

Code: Select all

$ deluge-gtk --version
deluge-gtk 2.0.3-2-201906121747-ubuntu18.04.1
libtorrent: 1.1.5.0
Python: 3.6.8
OS: Linux 4.15.0-65-generic
$ ver
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
$ python2 --version
Python 2.7.15+
$ python3 --version
Python 3.6.8
Client two:

Code: Select all

$ deluge-gtk --version
deluge-gtk: 1.3.15
libtorrent: 1.1.1.0
$ ver
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
$ python2 --version
Python 2.7.15+
$ python3 --version
Python 3.6.8
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: how to install both versions of deluge client?

Post by mhertz »

Sorry, haven't tried myself, but as long as you specify - c with another config-path, or, run from separate user accounts, then I believe it should be possible. Also, maybe run one client normally and the other in virtual env or docker. Lastly, maybe use thin client for one server and webui for other.

Just some thoughts before more knowledgeble members on this could elaborate further :)

Good luck.
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: how to install both versions of deluge client?

Post by iconoclasthero »

Thanks for the suggestions. The problem with the first two is that I'd have to install it (and it would install over the existing deluge) in order to run with a different config file. I've been using the last suggestion as my work around. I was hoping there would be some advice on how to deploy the two different deluge-gtk versions side-by-side without resorting to virtualization...but also realize that may not be possible.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: how to install both versions of deluge client?

Post by mhertz »

I guess it's possible to manually build and install the old deluge using another install-path than the new deluge already installed, though personally i'd make a virtualenv of the old instead.

I just tested this out shortly and which seemed to work, though i'm on arch-linux, so you need translate package-names to ubuntu, and of-course apt-get instead of pacman etc, if wanting to try this out yourself.

Code: Select all

sudo pacman -S python2-{virtualenv,pip} --noconfirm
virtualenv2 --system-site-packages ~/.local/deluge1
~/.local/deluge1/bin/pip2 install git+git://deluge-torrent.org/deluge.git@1.3-stable
sudo pacman -Rsn python2-{virtualenv,pip} --noconfirm
sudo pacman -S python2{-chardet,-xdg,-twisted,-pyopenssl} gtk2 pygtk --noconfirm
ln -nsf ~/.local/deluge1/bin/deluge-gtk ~/.local/bin/deluge1
You run the old deluge with(or add to systemd-service, startup-script, or likewise):

Code: Select all

deluge1 -c ~/.config/deluge1
Btw, I also could've installed all the deps I could for old deluge, directly into the virtualenv, but matter of preference and both ways work.

Just a suggestion... :)

Edit: After quick lookups through an ubuntu-packages search-page, then I believe this is the correct package-names under ubuntu:

Code: Select all

python{2,-virtualenv,-pip,-chardet,-xdg,-twisted,-openssl,-gtk2}
libgtk2.0-0
Edit2: You can also hardcode another profile-dir to always be used, to avoid needing the extra '-c' argument everytime:

Code: Select all

sed -i 's|return save_config_path(\"deluge\")|return save_config_path(\"deluge1\")|' ~/.local/deluge1/lib/python2.7/site-packages/deluge/common.py
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: how to install both versions of deluge client?

Post by iconoclasthero »

Thank you, I'm going to give this a try.
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: how to install both versions of deluge client?

Post by iconoclasthero »

The Python 2.7 tools were already installed:

Code: Select all

$ sudo apt install python-virtualenv python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-virtualenv is already the newest version (15.1.0+ds-1.1).
python-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
The creation of the virtual environment proceeded smoothly, but in ubuntu it is virtualenv not virtualenv2:

Code: Select all

$ virtualenv --system-site-packages ~/.local/deluge1
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/bvargo/.local/deluge1/bin/python2
Also creating executable in /home/bvargo/.local/deluge1/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
I'm assuming that the virtual environment only needs to be created once? Is there any way to copy my old config files over to the new VE or is that moot because most of the settings I would care about are server-side anyway?

I realized after I tried it on the machine with the old Deluge that ~/.local/deluge1/bin/pip2 install git+git://deluge-torrent.org/deluge.git@1.3-stable installs the old Deluge...no help there. So at some point, I would really like to know if I can install Deluge 2 into a Python 3 virtual environment...as an intermediate step prior to upgrading my deluge-gtk and then running the old deluge-gtk in the VE. I poked around on github a bit but it wasn't readily apparent to me.

Code: Select all

 
$ ~/.local/deluge1/bin/pip2 install git+git://deluge-torrent.org/deluge.git@1.3-stable
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting git+git://deluge-torrent.org/deluge.git@1.3-stable
  Cloning git://deluge-torrent.org/deluge.git (to revision 1.3-stable) to /tmp/pip-req-build-g7ezVt
  Running command git clone -q git://deluge-torrent.org/deluge.git /tmp/pip-req-build-g7ezVt
  Running command git checkout -b 1.3-stable --track origin/1.3-stable
  Switched to a new branch '1.3-stable'
  Branch '1.3-stable' set up to track remote branch '1.3-stable' from 'origin'.
Building wheels for collected packages: deluge
  Building wheel for deluge (setup.py) ... done
  Created wheel for deluge: filename=deluge-1.3.15.dev0-cp27-none-any.whl size=3594357 sha256=8d9363dead66604f7e8629a47197185018b76d79e37ecd90a562dabe7f7aa8d5
  Stored in directory: /tmp/pip-ephem-wheel-cache-fNIpe3/wheels/23/9d/b3/61a191d6c45e4feb0efdc97cd839ad8f58b1c4ab8b2d633d69
Successfully built deluge
Installing collected packages: deluge
Successfully installed deluge-1.3.15.dev0
your line: "sudo pacman -Rsn python2-{virtualenv,pip} --noconfirm" appears to be equivalent to sudo apt remove python2-virtualenv, python2-pip, however, I don't understand why this would be necessary if they weren't installed previously and in the case of having previously been installed would be contrary to what I want anyway. I omitted this.

The next line, "sudo pacman -S python2{-chardet,-xdg,-twisted,-pyopenssl} gtk2 pygtk --noconfirm" is analogous to sudo apt install, so...
[N.B. The following couple steps are really unnecessary after reading Edit 1, but for completeness sake.]

Code: Select all

$ sudo apt install python2{-chardet,-xdg,-twisted,-pyopenssl} gtk2 pygtk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python2-chardet
E: Unable to locate package python2-xdg
E: Unable to locate package python2-twisted
E: Unable to locate package python2-pyopenssl
E: Unable to locate package gtk2
E: Unable to locate package pygtk
so let's take care of the python ones first by removing the "2" after python and removing the "py" in front of "openssl." Everything is there except python-twisted and dependencies.

Code: Select all

$ sudo apt install python{-chardet,-xdg,-twisted,-openssl}
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-chardet is already the newest version (3.0.4-1).
python-chardet set to manually installed.
python-openssl is already the newest version (17.5.0-1ubuntu1).
python-openssl set to manually installed.
python-xdg is already the newest version (0.25-4ubuntu1).
python-xdg set to manually installed.
The following additional packages will be installed:
  python-attr python-automat python-click python-colorama python-constantly python-hyperlink python-incremental python-pam python-pyasn1 python-pyasn1-modules python-serial python-service-identity python-twisted-bin python-twisted-core python-zope.interface
Suggested packages:
  python-attr-doc python-pam-dbg python-twisted-bin-dbg python-qt3
The following NEW packages will be installed:
  python-attr python-automat python-click python-colorama python-constantly python-hyperlink python-incremental python-pam python-pyasn1 python-pyasn1-modules python-serial python-service-identity python-twisted python-twisted-bin python-twisted-core python-zope.interface
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,452 kB of archives.
After this operation, 16.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-attr all 17.4.0-2 [23.7 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-automat all 0.6.0-1 [25.1 kB]
.
.
.
Processing triggers for menu (2.1.47ubuntu2.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Since I'm running Ubuntu under GNOME Metacity Fallback and otherwise use GTK, I doubt I need to install anything GTK2 and there's no "gtk2":

Code: Select all

$ sudo apt-cache policy gtk2 <TAB>
gtk2.0-examples           gtk2-engines-aurora       gtk2-engines-cleanice     gtk2-engines-moblin       gtk2-engines-nodoka       gtk2-engines-pixbuf       gtk2-engines-sugar        gtk2-engines-xfce         gtk2hs-buildtools         
gtk2-engines              gtk2-engines-blueheart    gtk2-engines-equinox      gtk2-engines-murrine      gtk2-engines-oxygen       gtk2-engines-qtcurve      gtk2-engines-wonderland   gtk2-ex-formfactory-perl  

$ sudo apt-cache policy gtk2.0-examples 
gtk2.0-examples:
  Installed: (none)
  Candidate: 2.24.32-1ubuntu1
  Version table:
     2.24.32-1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
That leaves "pygtk." It looks like you suggested that the ubuntu equivalent changes the "pygtk" to "python-gtk2" and "gtk2" to "libgtk2.0-0." These are already installed (see also the N.B. above):

Code: Select all

$ sudo apt-cache policy *pygtk* *py-gtk* *python-gtk*
python-zbarpygtk:
  Installed: (none)
 .
 .  [irrelevant packages omitted]
 .
 python-gtk2-dev:
  Installed: (none)
  Candidate: 2.24.0-5.1ubuntu2
  Version table:
     2.24.0-5.1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
python-gtk2-doc:
  Installed: (none)
  Candidate: 2.24.0-5.1ubuntu2
  Version table:
     2.24.0-5.1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
python-gtkspell:
  Installed: (none)
  Candidate: (none)
  Version table:
python-gtk2:
  Installed: 2.24.0-5.1ubuntu2
  Candidate: 2.24.0-5.1ubuntu2
  Version table:
 *** 2.24.0-5.1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
.
.  [irrelevant packages omitted]
.
N: Unable to locate package *py-gtk*
N: Couldn't find any package by glob '*py-gtk*'
E: Regex compilation error - Invalid preceding regular expression
N: Couldn't find any package by regex '*py-gtk*'

$ sudo apt-cache policy libgtk2.0-0
libgtk2.0-0:
  Installed: 2.24.32-1ubuntu1
  Candidate: 2.24.32-1ubuntu1
  Version table:
 *** 2.24.32-1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
"ln -nsf ~/.local/deluge1/bin/deluge-gtk ~/.local/bin/deluge1" appears to create a symlink from deluge1 pointing to ~/.local/deluge1/bin/deluge-gtk (in the deluge1 virtual environment folder).

Code: Select all

$ ll ~/.local/bin/
total 52
drwxr-xr-x 2 user group 4096 Oct 26 09:50 ./
drwx------ 6 user group 4096 Oct 26 09:24 ../
-rwxrwxr-x 1 user group  210 Sep 22 10:09 beet*
lrwxrwxrwx 1 user group   42 Oct 26 09:50 deluge1 -> ~/.local/deluge1/bin/deluge-gtk*
I copied ~/.config/deluge/gtkui.conf to ~/.config/deluge1/gtkui.conf and launched it with

Code: Select all

$ deluge1 -c ~/.config/deluge1

Command 'deluge1' not found, did you mean . . .
...
$ ~/.local/bin/deluge1 -c ~/.config/deluge1
(deluge:25732): Gtk-WARNING **: 09:58:47.899: Unable to locate theme engine in module_path: "hcengine",
I don't know why ~/.local/bin should or shouldn't be in $PATH, but it wasn't... and I'm assuming that hcengine is superfluous (and I believe I was getting these same errors before the upgrade to deluge-gtk 2.0).

And with that, I was able to connect from the client that initially had deluge-gtk 2.0 installed to the server that still has deluged 1.3 running, getting me from the deluge-gtk 2.0 client to deluged 1.3 server.

So basically I think I just need to do the same thing for the Python 3.6 environment on the client with deluge-gtk 1.3. The only part I'm unclear about is how to get the deluge-gtk 2.0 client from git. After that, it looks like I just translate all the steps to Python 3.6. Since this is actually the more important client-server pair, I'll probably give that a go or upgrade that machine to deluge-gtk 2.0 and then use the virtual environment to load it.

Thanks for the help and letting me know about VE. I thought I was going to need to use a VM and that really isn't the direction I wanted to go.
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: how to install both versions of deluge client?

Post by iconoclasthero »

This is essentially what I did to get the Python 3 VE created to run deluge-gtk 2.0 on an Ubuntu 18.04 machine with a native deluge-gtk 1.3 installation.

Code: Select all

$ sudo apt install python3-pip python3-venv python3-virtualenv	#all already existed
$ mkdir ~/bin/deluge2												#this will be easier to find b/c I don't use ~/.local/bin
$ python3 -m venv --system-site-packages ~/bin/deluge2	#creates the VE
$ ~/bin/deluge2/bin/pip3 install deluge     				 #install Deluge 2.0 via pip3—how to install just the GTK client?
$ ln -nsf ~/bin/deluge2/bin/deluge-gtk ~/bin/deluge2-gtk #creates link in binary directory for deluge2-gtk
$ deluge2-gtk -c ~/.config/deluge2							  #calls deluge-gtk 2.0 from the command line with the config file in ~/.config/deluge2
Last edited by iconoclasthero on Mon Oct 28, 2019 2:54 am, edited 1 time in total.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: how to install both versions of deluge client?

Post by mhertz »

Good job finding this out and succeeding and I apologize for the confusion, as I for some reason had gotten in my head that you had deluge2 installed and wanted deluge1 also, possibly because I was thinking of likewise previous post by another I'm guessing, and deluge1 wasn't even in pip database, so had getting it from a git branch through pip instead in the instructions I tested and gave you.

Yeah I use '~/.local/bin' as user-bin-dir which I've added to Path I should've specified also.

I don't think you can only install GTKUI from pip either, only full package.

Thanks for posting Debian instructions for others to use.
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: how to install both versions of deluge client?

Post by iconoclasthero »

It's working well on both machines. Maybe I should have been a bit more clear: I have two machines, both are servers and clients. I upgraded only one of the machines to Deluge 2 and discovered that they could no longer talk to each other. So I needed Deluge-GTK 1 on the machine w/the upgrade (which happens to be my server/desktop) and I needed Deluge-GTK 2 on the machine that has not been upgraded (my laptop). I'm wondering if there's a way to reassign how the magnet links get handled by the latter machine so that it defaults to my server/desktop, but that is probably an Ubuntu question...and it isn't that hard to copy the magnet link and paste it into Deluge. It's much better than the web UI!
Post Reply