Ubuntu One on Debian Wheezy


PLEASE DO NOT USE THIS AT THE MOMENT. I’M WORKING ON A BETTER AND UPDATED VERSION.

I tried to update the electron repulsion integral handler libint in our
quantum chemical code AICCM. But the linking against gmp failed on my
Ubuntu 12.04 LTS. After discovering that it would build on a Debian Wheezy I
decided to install Debian on my computer. Since I am using the Ubuntu One cloud
service to sync all my data across various machines, including
smartphone and tablet, I was disappointed to find out that there are no
packages available for Debian. I did not want to abandon the service since I am a paid subscriber. It is only 29.99$ per year for 25GB.

After searching through forums and trying
several failed approaches to use the binary packages from Ubuntu 12.04 I
decided to build it from the sources.

In this blog entry I would like to give a detailed description how to build and install Ubuntu One on a Debian system. If you have any questions or comments please do not hesitate to contact me.

Create a subdirectory in your $HOME where you want to install Ubuntu One:

mkdir $HOME/UbuntuOne
cd $HOME/UbuntuOne

and install the dependencies:

 
apt-get install python-twisted pyqt4-dev-tools bzr python-lazr.restfulclient python-oauth python-pyinotify python-protobuf gnome-common gobject-introspection xutils-dev libnautilus-extension-dev libgconf2-dev libebook1.2-dev gnome-settings-daemon-dev python-twisted-names python-libproxy python-distutils-extra python-setuptools

There are two ways to obtain the source code (1b is recommended):

1a. From bazaar repository (latest development version)

bzr branch lp:configlue

bzr branch lp:dirspec
bzr branch lp:ubuntuone-client
bzr branch lp:ubuntuone-storage-protocol
bzr branch lp:ubuntu-sso-client

If you are using this option you need to neglect the version numbers in the following.

1b. Download the tarball from launchpad (latest stable version)

wget https://launchpad.net/dirspec/stable-3-0/3.0.0/+download/dirspec-3.0.0.tar.gz
wget https://launchpad.net/ubuntu-sso-client/trunk/1.3.3/+download/ubuntu-sso-client-1.3.3.tar.gz
wget https://launchpad.net/configglue/trunk/1.0.3/+download/configglue-1.0.3.tar.gz
wget https://launchpad.net/ubuntuone-storage-protocol/stable-3-0/3.0.0/+download/ubuntuone-storage-protocol-3.0.0.tar.gz
wget https://launchpad.net/ubuntuone-client/trunk/2.0.0/+download/ubuntuone-client-2.0.0.tar.gz

If you have downloaded the latest stable version you have to extract all downloaded archives

tar -zxvf configglue-1.0.3.tar.gz
tar -zxvf dirspec-3.0.0.tar.gz
tar -zxvf ubuntuone-client-3.0.1.tar.gz
tar -zxvf ubuntuone-storage-protocol-3.0.0.tar.gz
tar -zxvf ubuntu-sso-client-1.3.3.tar.gz

2. Set the $PYTHONPATH

As most parts of the Ubuntu One client are written in Python you need to add the folders to your  $PYTHONPATH either in the .zshrc if you are using the zshell or .bashrc if you are using bash shell. The files are in your $HOME directory. If you do not know what I am talking about you are using the bash shell. Then you need to replace .zshrc by .bashrc in the following.

So open the file in your favorite editor (I use vim):

vim ~/.zshrc

And add the following lines:
# Ubuntu One PYTHONPATH
export PYTHONPATH=”$HOME/UbuntuOne/configglue-1.0.3:$PYTHONPATH”
export PYTHONPATH=”$HOME/UbuntuOne/dirspec-3.0.0:$PYTHONPATH”
export PYTHONPATH=”$HOME/UbuntuOne/ubuntuone-client-3.0.1:$PYTHONPATH”
export PYTHONPATH=”$HOME/UbuntuOne/ubuntuone-storage-protocol-3.0.0:$PYTHONPATH”
export PYTHONPATH=”$HOME/UbuntuOne/ubuntu-sso-client-1.3.3:$PYTHONPATH”

The $PATH and $LD_LIBRARY_PATH variable needs modification, too. So also add this:

# Ubuntu One PATH

export PATH=”$HOME/UbuntuOne/ubuntu-sso-client-1.3.3/bin:$PATH”
export PATH=”$HOME/UbuntuOne/ubuntuone-client-3.0.1/bin:$PATH”
export LD_LIBRARY_PATH=”$HOME/UbuntuOne/ubuntuone-client-3.0.1/libsyncdaemon:$LD_LIBRARY_PATH”

Then reload the settings:

source ~/.zshrc

3. Build the client:

The next step is to build the client. Note that you do not need to run make install and pollute your $HOME πŸ™‚

cd $HOME/UbuntuOne/configglue-1.0.3
python setup.py config build
cd $HOME/UbuntuOne/dirspec-3.0.0
python setup.py config build
cd $HOME/UbuntuOne/ubuntuone-storage-protocol-3.0.0
python setup.py config build
cd $HOME/UbuntuOne/ubuntu-sso-client-1.3.3
python setup.py config build

cd $HOME/UbuntuOne/ubuntuone-client-3.0.1
./configure && make
rehash

3. Get an auth token

Download this script from an Ubuntu One developer (Roman Yepishev) and run it to generate an auth key:

wget http://people.canonical.com/~roman.yepishev/us/ubuntuone-sso-login.py 
python ubuntuone-sso-login.py 
Ubuntu SSO Login: **your Ubuntu SSO Login**
Password: **your Ubuntu SSO Password**
oauth=hPQWPsH:rhOokmNiRuuoiHe... 

4. Copy the configuration file and add an auth token 

Create the directory and copy the config file of the server:

mkdir ~/.config/ubuntuone
cp $HOME/UbuntuOne/ubuntuone-client-2.0.0/data/syncdaemon.conf $HOME/.config/ubuntuone/syncdaemon.conf
Open the file and add the auth token:
[__main__]
oauth=hPQWPsH:rhOokmNiRuuoiHe... 

This part (3. & 4.) is best described here.

5. Wrapper files

To be able to run the client on a headless server or via ssh you need to create 3 files and put them to $HOME/bin and add it to your $PATH variable.

The files look like this:

u1sdtool-wrapper
#!/bin/bash
# u1sdtool wrapper for headless Ubuntu One
if [ -z “$DBUS_SESSION_BUS_ADDRESS” ]; then
    ENVVAR=”DBUS_SESSION_BUS_ADDRESS”
    eval $(ps xe | grep “[u]buntuone-syncdaemon.*$ENVVAR” |
           sed -E “s/.*($ENVVAR=[^ ]+).*/1/g” )
    if [ -z “$DBUS_SESSION_BUS_ADDRESS” ]; then
        # Ubuntu One is not running and we don’t have a dbus daemon
        eval `dbus-launch –sh-syntax`
    fi
    export DBUS_SESSION_BUS_ADDRESS
fi
exec u1sdtool “$@”
ubuntuone-syncdaemon-wrapper
#!/bin/bash
# wrapper for headless Ubuntu One
if [ -z “$DBUS_SESSION_BUS_ADDRESS” ]; then
    ENVVAR=”DBUS_SESSION_BUS_ADDRESS”
    eval $(ps xe | grep “[u]buntuone-syncdaemon.*$ENVVAR” |
           sed -E “s/.*($ENVVAR=[^ ]+).*/1/g” )
    if [ -z “$DBUS_SESSION_BUS_ADDRESS” ]; then
        # Ubuntu One is not running and we don’t have a dbus daemon
        eval `dbus-launch –sh-syntax`
    fi
    export DBUS_SESSION_BUS_ADDRESS
fi
exec ubuntuone-syncdaemon $HOME/.config/ubuntuone/syncdaemon.conf &
ubuntu-sso-login-wrapper
#!/bin/bash
# ubuntu-sso-login wrapper for headless Ubuntu One
if [ -z “$DBUS_SESSION_BUS_ADDRESS” ]; then
    ENVVAR=”DBUS_SESSION_BUS_ADDRESS”
    eval $(ps xe | grep “[u]buntuone-syncdaemon.*$ENVVAR” |
           sed -E “s/.*($ENVVAR=[^ ]+).*/1/g” )
    if [ -z “$DBUS_SESSION_BUS_ADDRESS” ]; then
        # Ubuntu One is not running and we don’t have a dbus daemon
        eval `dbus-launch –sh-syntax`
    fi
    export DBUS_SESSION_BUS_ADDRESS
fi
exec ubuntu-sso-login “$@”

6. Start the syncdeamon

ubuntuone-syncdaemon-wrapper

7. Use the u1sdtool-wrapper

This shows you the available commands:

u1sdtool-wrapper –help

These might be tho ones you need the most:

u1sdtool-wrapper –status
u1sdtool-wrapper –current-transfers

u1sdtool-wrapper –list-folders

Examples:

1. Add a folder to be synched (that is already in the cloud)

Type:

u1sdtool-wrapper –list-folders

Get:
Folder list:
  id=2ce31368-0a79-411e-XXX subscribed=False path=/home/mpei/Xoom
Type:
u1sdtool-wrapper –subscribe-folder=2ce31368-0a79-411e-XXX

Known issues:

1. network-manager / connection: With User Not Network

I have configured my network manually via config files. I got the connection status from u1sdtool-wrapper –status that I was not connected with the network. This was due to the fact that the network manager was telling everybody via dbus that the computer does not have an internet connection.
Uninstalling network-manager via 
apt-get purge network-manager

fixed the problem for me πŸ™‚

6 Replies to “Ubuntu One on Debian Wheezy”

  1. I followed all your post without troubles until the end. I am using Linux Mint Debian Edition (Basically a Debian Testing). At the end I had the issue with the network but removing network-manager did not solve the problem.

    This is my error.

    tsunami UbuntuOne # ./u1sdtool-wrapper –list-folders
    Unhandled Error
    Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 413, in fireEvent
    DeferredList(beforeResults).addCallback(self._continueFiring)
    File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 298, in addCallback
    callbackKeywords=kw)
    File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 287, in addCallbacks
    self._runCallbacks()
    File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
    — —
    File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 426, in _continueFiring
    callable(*args, **kwargs)
    File "/root/UbuntuOne/ubuntuone-client-2.0.0/bin/u1sdtool", line 61, in main
    bus = dbus.SessionBus(mainloop=loop)
    File "/usr/lib/python2.7/dist-packages/dbus/_dbus.py", line 219, in __new__
    mainloop=mainloop)
    File "/usr/lib/python2.7/dist-packages/dbus/_dbus.py", line 108, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
    File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 125, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
    dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

    1. Did you configure your network manually in /etc/network/interfaces? Only then the removal of network-manager is required. It looks more like the syncdeamon did not start.

      The wrapper script is only needed when you're logged in via ssh and not sitting in front of the computer.
      Try the following (starting syncdeamon without the wrapper script in debug mode):
      ubuntuone-syncdaemon ~/.config/ubuntuone/syncdaemon.conf –debug

      Then try:
      u1sdtool-wrapper –status

      Please paste the output of this status here so I can see if the connection succeeded!

      Hope this helps

      Cheers

      Michael

  2. Hi, there! I've read your first line on this post asking to not try this, but I'm helpless on my efforts to have Ubuntu One on my "Debian machine".

    I followed your steps, installing some missing dependencies here and everything went almost fine, except for stepes 6 and 7, where I get something like

    lymber@mat-106a:~/UbuntuOne/ubuntu-sso-client-1.3.3$ cd
    lymber@mat-106a:~$ ubuntuone-syncdaemon-wrapper
    lymber@mat-106a:~$ Traceback (most recent call last):
    File "/home/lymber/UbuntuOne/ubuntuone-client-3.99.91/bin/ubuntuone-syncdaemon", line 49, in
    from ubuntuone.platform import (
    File "/home/lymber/UbuntuOne/ubuntuone-client-3.99.91/ubuntuone/platform/__init__.py", line 49, in
    from ubuntuone.platform import credentials
    File "/home/lymber/UbuntuOne/ubuntuone-client-3.99.91/ubuntuone/platform/credentials/__init__.py", line 42, in
    from ubuntu_sso import UI_EXECUTABLE_QT
    ImportError: cannot import name UI_EXECUTABLE_QT

    lymber@mat-106a:~$

    and

    lymber@mat-106a:~$ u1sdtool-wrapper –help
    Traceback (most recent call last):
    File "/home/lymber/UbuntuOne/ubuntuone-client-3.99.91/bin/u1sdtool", line 59, in
    from ubuntuone.platform.tools import (
    File "/home/lymber/UbuntuOne/ubuntuone-client-3.99.91/ubuntuone/platform/__init__.py", line 49, in
    from ubuntuone.platform import credentials
    File "/home/lymber/UbuntuOne/ubuntuone-client-3.99.91/ubuntuone/platform/credentials/__init__.py", line 42, in
    from ubuntu_sso import UI_EXECUTABLE_QT
    ImportError: cannot import name UI_EXECUTABLE_QT
    lymber@mat-106a:~$

    Do you understand the reasons for this? If so, what should I do in order to have it working here?

    Do you think it's a good/plausible idea to have a Debian package for this client?

    Hope to hear from you soon.

    Thanks in advance, Alexandre.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.