Learn how to install the latest version of SVN (1.8.19) in CentOS 7.

How to install subversion client (SVN) version 1.8.19 in CentOS 7

In the last days, I had to deploy some legacy applications in a new server with CentOS 7. Instead of deploying the whole project from the start (cloning with subversion, then installing dependencies, fixing permissions etc.) I decided to just zipping the whole directory and pasting it into the new server. It proved to be a good solution as it just worked in the new server, zero downtime. The only problem I found was that when I made some changes to the codebase of the project, and tried to pull the changes (svn update), the following error showed up: This client is too old to work with working copy 'XXX'

This problem happens when the working copy (the cloned project) was cloned in a server with a higher version of subversion than the svn version of the current server e.g my project was working with 1.8.16 and the new server has an older version 1.5.6. To solve this problem, I only needed to update the SVN client version to a recent version in the new server.

In this article, I will explain to you how to easily install the latest SVN version available in your CentOS 7.

1. Add new subversion repository

The first thing you need to do is to register the new repository where the latest subversion is installed, otherwise you will install the default version of CentOS 7, which is a little bit outdated. Create the repository file with the following command (you can use nano or vim to create it, it is up to you, in my case I will use nano):

nano /etc/yum.repos.d/wandisco-svn.repo

Then, paste the following content in the file:

[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/$releasever/svn-1.8/RPMS/$basearch/
enabled=1
gpgcheck=0

Save the changes and proceed with the next step.

2. Uninstall current version

Before proceeding with the installation, you need to uninstall the current installed client in the server with the following command (be sure to include the asterisk at the end as this will uninstall all the SVN related stuff):

yum remove subversion*

Once you remove the installed client, proceed with the next step.

3. Install new version

Now it's necessary to install the newer version of SVN. Proceed to remove the cache of repositories which are enabled in /etc/yum using the following command:

yum clean all

Then, install the new version with:

yum install subversion

This will generate an output similar to the following one:

Resolving Dependencies
--> Running transaction check
---> Package subversion.x86_64 0:1.8.19-1 will be installed
--> Processing Dependency: libserf-1.so.0()(64bit) for package: subversion-1.8.19-1.x86_64
--> Running transaction check
---> Package libserf.x86_64 0:1.3.7-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================================
 Package                                           Arch                                          Version                                              Repository                                          Size
===============================================================================================================================================================================================================
Installing:
 subversion                                        x86_64                                        1.8.19-1                                             WandiscoSVN                                        2.2 M
Installing for dependencies:
 libserf                                           x86_64                                        1.3.7-1.el7                                          WandiscoSVN                                         52 k

Transaction Summary
===============================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total size: 2.2 M
Installed size: 7.8 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libserf-1.3.7-1.el7.x86_64                                                                                                                                                                  1/2
  Installing : subversion-1.8.19-1.x86_64                                                                                                                                                                  2/2
  Verifying  : subversion-1.8.19-1.x86_64                                                                                                                                                                  1/2
  Verifying  : libserf-1.3.7-1.el7.x86_64                                                                                                                                                                  2/2

Installed:
  subversion.x86_64 0:1.8.19-1

Dependency Installed:
  libserf.x86_64 0:1.3.7-1.el7

Complete!

Once the installation completes, you should be able now to check the version using the following command:

svn --version

This command will output 

svn, version 1.8.19 (r1800620)
   compiled Aug 11 2017, 09:34:52 on x86_64-redhat-linux-gnu

Copyright (C) 2017 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

After upgrading the version in my new server, I'm able to update the working copy as expected.

Happy coding ❤️!


Senior Software Engineer at Software Medico. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Sponsors