Linux svn的安装

orzdba这个工具是taobao开发的,是一个很不错的工具。orzdba工具下载,需要使用到svn进行下载。所以首先就要先安装svn工具。然而,svn的安装也是比较麻烦的,需要各种包进行支持。

环境:RHEL 6.4 x86_64


1. 使用yum安装一些RPM包

# yum install libserf libtool autoconf gcc libapr libapr-util *sqlite* libz libmagic apr-devel apr-util-devel perl-Class-Data-Inheritable.noarch

2. 安装serf-1.2.1


yum -y install expat-devel
wget http://serf.googlecode.com/files/serf-1.2.1.tar.bz2
tar xjf serf-1.2.1.tar.bz2
cd serf-1.2.1
./configure --prefix=/usr/local/serf
make && make install
 
说明:
(1)1.8版本之前的需要加neon,1.8版本之后弃用neon而改使用serf;
(2)这里使用的是serf-1.2.1,据说subversion 1.8版本使用serf-1.3.0会有异常。
 

3. svn安装

下载subversion:
https://subversion.apache.org/download/
说明:这里使用源码安装。虽然也有RPM包,但每次使用RPM包安装都是失败的。
安装subversion时需要使用到sqlite 3.7.15.1 amalgamation,所以也下载:
http://www.sqlite.org/sqlite-amalgamation-3071501.zip
 
tar xvzf subversion-1.8.9.tar.gz
unzip sqlite-amalgamation-3071501.zip -d ./subversion-1.8.9/
cd subversion-1.8.9/
mv sqlite-amalgamation-3071501 sqlite-amalgamation
./configure --with-serf=/usr/local/serf   ## 1.8版本之前,使用neon,--with-neno=/usr/local/neon
make && make install
 

4. 验证svn是否安装正确


# svn --version
svn, version 1.8.9 (r1591380)
   compiled Aug  1 2014, 22:22:48 on x86_64-unknown-linux-gnu
 
Copyright (C) 2014 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/
 
The following repository access (RA) modules are available:
 
* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.2.1
  - handles 'http' scheme
  - handles 'https' scheme
支持http、https,安装是OK的。
 
 

5. 安装错误处理方法

(1)在subversion的./configure时出现如下错误:
checking sqlite library version (via header)... unsupported SQLite version
checking sqlite library version (via pkg-config)... none or unsupported 3.6.20
no
 
An appropriate version of sqlite could not be found.  We recommmend
3.7.15.1, but require at least 3.7.12.
Please either install a newer sqlite on this system
 
or
 
get the sqlite 3.7.15.1 amalgamation from:
    http://www.sqlite.org/sqlite-amalgamation-3071501.zip
unpack the archive using unzip and rename the resulting
directory to:
/root/subversion-1.8.9/sqlite-amalgamation
 
configure: error: Subversion requires SQLite
 
就是由于sqlite的版本过低导致,解决办法:
下载:http://www.sqlite.org/sqlite-amalgamation-3071501.zip
然后unzip解决到./subversion-1.8.9/sqlite-amalgamation目录下,重新./configure后通过。
 
(2)安装完成subversion后,使用svn获取http或https上资源时报错:
# svn co http://code.taobao.org/svn/orzdba/trunk 
svn: E170000: Unrecognized URL scheme for ‘http://code.taobao.org/svn/orzdba/trunk‘
 
解决办法:
在安装subversion之前没有先安装serf。当安装了serf后重新编译subversion即可。
 


Linux svn的安装,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。