Debian 5 comes with CouchDB 0.8 - this is too old. The same is true for Ubuntu 9.04 and 9.10.
I will show how to compile CouchDB 1.0.
Why? It's a good idea to install the debian Packages to resolve all dependencies. But you should remove this 3 packages before install the self-compiled versions.
⇒ erlang installed in /usr/local
Test: start erl
(Quit with Ctrl-C, Ctrl-C, ….)
configure: error: The installed Erlang version is less than 5.6.5 (R12B05).
than you have to compile a newer version of erlang. See above.