Skip to main content

Installing Subversion (svn) on Linux (Debian Stable)

This post details my recent install of Subversion 1.2.1 on Debian Stable. The Debian packaged version of Subversion is currently only 1.1.4, but I wanted to install the latest version as it supports full WebDAV autoversioning & has the FSFS repository back end as the default.

I wanted to access Subversion via the WebDAV protocol, this requires Apache2. As Debian Stable only recently included the apache2 package, I had to update to that version first.

Note: all these commands were run as the root user.

Install Apache2:

apt-get install apache2

That installs the web server and all the required packages, it does not start Apache by default, you need to edit /etc/default/apache2 and change NO_START to 0, then run /etc/init.d/apache2 start to get the basic web server running.

When you build Subversion from source, it requires the apxs2 tool to be able to build and install the Subversion extension modules. This is hidden away in the apache2-threaded-dev package, it's not available in any other package:

apt-get install apache2-threaded-dev

Now we need to download, build and install Subversion. Download Subversion 1.2.1 and save it in /usr/local/src

Unpack Subversion:

tar zxvf subversion-1.2.1.tar.gz
cd subversion-1.2.1

We now need to ensure that all build dependencies are taken care of, plus let the build scripts know where the apxs2 tool is located (it's in a non-standard place with Debian):

./configure --with-apxs=/usr/bin/apxs2

Build Subversion:

make

Run the unit tests to ensure that the built version is a valid release (note: this can take quite a while - well at least it does on my poor Celeron Linux server!):

make check

Install the Subversion binaries and libraries to the correct places:

make install

OK, that's Subversion installed, but it's not available yet, we still need to config access to it via Apache, and create the initial code repository. Please see my next post on how to do this...

Technorati Tags: , , ,

Comments

Rajan said…
Hi Andrew,

I found the post on subversion very useful. Keep up the good work.

Rajan
Anonymous said…
now you can install subversion on Debian only with

apt-get install subversion
Andrew Beacock said…
You are quite correct Anonymous but the Debian packaged versions are normally quite a number of releases out of date compared to the cutting edge releases that I'm interested in.

I've just check now and the Debian Stable release is still at 1.1.4 where as the latest one is 1.4.0!
Anonymous said…
your guide is pretty useful. I also found this guide to be pretty nice (http://www.debian-administration.org/articles/208).

Some notes:
- I noticed that "make" complains that I didn't have python installed. you should probably mention that as a dependency.
- I tried to install SVN 1.4.0 and 1.4.2 on a brand new stable copy of Debian Sarge and it failed because the Apache Portable Runtime is too old (0.9.6) when 0.9.7 is required.
- Installing SVN 1.3.2 worked just fine.
Andrew Beacock said…
Thanks for the tips Grady!
Unknown said…
very useful for me.. thanks. need more deep things about SVN


iqbal...