Fixing Supervisor on Ubuntu 11.04
So, you’ve just upgraded to Ubuntu 11.04, and now Supervisor doesn’t work. You need a workaround, but don’t want to touch any of the files managed by apt. Here’s what to do.
The Problem
Supervisor depends on a Python package called meld3. The version that ships with Ubuntu 11.04, 0.6.6, does not work with the default Python interpreter. The latest version, 0.6.7, works just great. We need a nice, unobtrusive way to get this package fixed.
What To Do
The good news is that I found a pretty easy solution. The bad news is that you will end up editing one file managed by apt, but it’s just an init script and it shouldn’t be too hard to remove the change if necessary.
In the examples below, $ is your Unix prompt. I’m assuming that vim is your text editor, but you’re free to use something else if you are a Communist would like to use another editor.
$ sudo mkdir -p /opt/python-hacks
$ wget http://pypi.python.org/packages/source/m/meld3/meld3-0.6.7.tar.gz
$ tar -xvzf meld3-0.6.7.tar.gz
$ sudo cp -R meld3-0.6.7/meld3 /opt/python-hacks/meld3
$ rm -rf meld3-0.6.7.tar.gz meld3-0.6.7
$ sudo apt-get install supervisor
$ sudo vim /etc/init.d/supervisor
In your editor, you should find the line that says:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Underneath it, add the following lines:
if [ -d /opt/python-hacks ]; then
PYTHONPATH=/opt/python-hacks
export PYTHONPATH
fi
Save the file. Now you should be able to start supervisor:
$ sudo /etc/init.d/supervisor start
And it should work this time, because Python finds your custom meld3 package first and uses that instead of the one provided by Ubuntu.
Cleaning It Up Later
Eventually, Canonical will release an update that fixes this issue, and you’ll want to remove this improvised fix. Easy:
$ sudo rm -rf /opt/python-hacks
Done.
