Thursday, 21 June 2012

HOWTO: Subversion 1.7.x on Centos 6

Howto: Subversion 1.7.x on Centos 6

Prerequisites:
* Minimal CentOS 6 installation
* SELinux & Firewall disabled

First, I'm going to start off with a bit of a mini-rant.

As usual, installing stuff on RHEL/CentOS is much harder than it is on Debian based systems. For one, the repositories are far more limited and what packages there are  are hopelessly outdated. Of course I understand that the RHEL philosophy is to freeze packages for a particular major version (6 in this case) and only provide security and bug fixes to these packages because this makes sense when running servers in a business environment, which is, of course, their target market.

This is a good thing.

However sometimes you want a newer version of something for whatever reason. Debian manages this by having a backports repository which can be optionally enabled to allow easy access to newer packages from the Debian testing branch. From what I can tell RHEL/CentOS do not have an equivalent option. Of course there are third party repositories that provide access to newer packages (to a degree), but coverage is sporadic at best.

In this case we will be required to resort to manually downloading third party RPM packages from WANDisco because they are not provided via any repository I could find. Apparently you are meant to fill out some sort of webform where you have to provide them with your personal details and "request" the packages along with an installer script that will allegedly install all the dependancies.

Feel free to go and fill out that form, however, I wasn't willing to go that route, it evoked too many memories of when I used to be a Windows user, where everything comes with strings attached.

The good news is that the RPMs are available without having to request them by going directly to here. The bad news is that these packages are for RHEL/CentOS 5 and I have been unable to find the equivalent packages for CentOS 6. This crucial difference will cause us to briefly flirt with the dreaded dependancy hell later on.

So, the first step is to obtain the following packages (64 bit links to my site below);

subversion-1.7.5-1.x86_64.rpm
mod_dav_svn-1.7.5-1.x86_64.rpm
neon-0.25.5-10.el5_4.1.x86_64.rpm

Note: If you don't want to trust my linked packages (and why should you?) or you require 32 bit versions then the first two are available from the WANDisco website mentioned above, the third I found at rpm.pbone.net.

OK, with the three files in hand, we probably should ensure our system is up to date before we proceed.

yum update

Subversion requires Apache web server, let's install it now;

yum install httpd

You probably want Apache to start automatically after a reboot;

chkconfig httpd on

We should also start it now;

service httpd start

These dependencies are required for SVN 1.7.x and thankfully they are all available in the standard CentOS repository;

yum install openssl098e compat-db43 compat-expat1 compat-openldap

Tip: In cases like this you can use something like "yum whatprovides ./libldap-2.3.so.0" to find where your dependencies live

Here's where we hit a minor snag. If we try and install the subversion rpm at this point it will complain that it depends on neon-0.25 but the CentOS6 repository provides v0.29.

Another rant: This is another bugbear I have with the yum/rpm system. It seems to be much more finicky than Debian and backwards compatibility is often non-existent. In this case the WANDisco RPM has been built to explicitly require neon 0.25 even though I am pretty sure that v 0.29 is fully backwards compatible and would work. It's a stupid situation and one that I honestly can't remember finding in Debian/Ubuntu over nearly 10 years of using that distro. Maybe that is because you are not forced to rely on dodgy third party compiled packages on a regular basis I suppose.

Anyway, luckily for us neon does not have any onerous dependency requirements of it's own so we can go ahead and install the older version manually without falling into dependency hell, which is a bit of luck.

rpm -i neon-0.25.5-10.el5_4.1.x86_64.rpm

With neon v0.25 installed, we can go ahead and install subversion and mod_dav_svn;

rpm -i subversion-1.7.5-1.x86_64.rpm
rpm -i mod_dav_svn-1.7.5-1.x86_64.rpm


Note: If you see something like this;

warning: mod_dav_svn-1.7.5-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 3bbf077a: NOKEY

you can ignore it, unless you want to obtain and configure the appropriate validation keys for these files which is outside the scope of this document.

We can confirm that subversion is now installed;

# rpm -qa | grep subversion
subversion-1.7.5-1.x86_64


OK, all is good, right? Well, yes and no. Everything is OK right now but if you try and do a yum update, it will fail like this;

--> Finished Dependency Resolution
Error: Package: subversion-1.7.5-1.x86_64 (installed)
           Requires: libneon.so.25()(64bit)
           Removing: neon-0.25.5-10.el5_4.1.x86_64 (installed)
               libneon.so.25()(64bit)
           Updated By: neon-0.29.3-1.2.el6.x86_64 (base)
               Not found
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest


Aaargh!

To workaround this, we can exclude neon from being updated;

vi /etc/yum.conf

Add this line somewhere in the file;

exclude=neon*

Now our yum update won't try and upgrade neon and therefore complain about dependency problems;

# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.swin.edu.au
 * extras: ftp.swin.edu.au
 * updates: ftp.swin.edu.au
base                                                                                                 
extras    updates                                                                                              Setting up Update Process
No Packages marked for Update


And that's it, go grab yourself a beverage for a job well done!

3 comments:

krizna said...

Thanks .. very useful
Install svn server on centos 6

krizna said...

Thanks .. very useful
Install svn server on centos 6

Stephen said...

RHEL6 link: http://opensource.wandisco.com/centos/6/svn-1.7/RPMS/