Linux/SUSE安装svn客户端的问题记录

次阅读

这 2 天负责架设一个支付业务的 webserver 测试项目,安装 svn 客户端的时候出现了各种问题,来记录下。

svn

一、简单的说下安装过程:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#下载
wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.9.tar.gz
#解压
tar zxvf subversion-1.6.9.tar.gz
tar zxvf subversion-deps-1.6.9.tar.gz
#编译
cd subversion-1.6.9
./configure --prefix=/usr/local/svn --without-berkeley-db
make
make install

执行 svn –version 查看是否有版本输出,如果提示找不到命令,则如下编辑 /etc/profile

1
vim /etc/profile

在后面追加 SVN 变量即可:

1
2
3
4
5
#追加
export SVN_HOME=/usr/local/svn
export PATH=$SVN_HOME/bin:$PATH
#刷新
source /etc/profile

二、安装过程中出现的问题:

1、提示 OpenSSL 缺失

configure 配置 SVN 时可能提示如下错误信息:

1
configure: error: We require OpenSSL; try --with-openssl

解决方法:编译前先安装 openssl 即可

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
cd /usr/local/src
wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz
tar -zxvf openssl-1.0.0a.tar.gz
cd openssl-1.0.0a
./config
./config -t
make depend
make
make test
make install

安装之后会在/usr/local下生成一个ssl目录,编译 SVN 时加上 openssl 路径即可:

1
./configure --prefix=/usr/lcoal/svn --without-berkeley-db --with-openssl=/usr/local/ssl

2、zlib 依赖缺失

configure 配置 SVN 时可能提示如下错误信息:

1
configure: error: subversion requires zlib

解决办法:安装 zlib

1
2
3
4
5
6
7
cd /usr/local/src
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -xvzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install

3、expat 依赖缺失

configure 配置 SVN 时可能提示如下错误信息:

1
configure: error: no XML parser was found: expat or libxml 2.x required

解决办法:安装 expat

1
2
3
4
5
6
7
cd /usr/local/src
wget http://nchc.dl.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz
tar -zxvf expat-2.1.0.tar.gz
cd expat-2.1.0
./configure
make
make install

4、SQLite 依赖缺失

报错信息如下:

1
2
3
4
5
6
get the sqlite 3.7.6.3 amalgamation from:
http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz
unpack the archive using tar/gunzip and copycopy sqlite3.c from the
resulting directory to:
/home/software/subversion-1.7.0-rc3/sqlite-amalgamation/sqlite3.c
configure: error: Subversion requires SQLite

如果按照文章开头的方法安装,则不会出现此错误

解决办法:加入 sqlite3.c 模块后再编译

①、下载报错信息里面的 sqlite-amalgamation-3.7.6.3.tar.gz 并解压:

1
wget http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz

②、在 svn 源码目录创建 sqlite-amalgamation 文件夹

1
2
cd subversion-1.6.9
mkdir sqlite-amalgamation

③、拷贝 sqlite-amalgamation-3.7.6.3.tar.gz 解压后的 sqlite3.c 到 sqlite-amalgamation 文件夹:

1
cp ../sqlite-amalgamation-3070800/sqlite3.c ./sqlite-amalgamation/

④、重新编译 svn 即可。

4、/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value

报错信息如下:

1
2
3
4
5
6
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s23_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libserf-0.la] Error 1
make[1]: Leaving directory `/usr/local/src/subversion-1.6.9/serf'
make: *** [external-all] Error 1

解决办法:添加 –without-serf 参数重新编译 subversion 即可,比如:

1
./configure --prefix=/usr/local/svn --without-berkeley-db --without-serf

5、不支持http://方式

全部安装完成,使用如下命令配置 svn 的时候:

1
svn co http://192.168.1.101/deploy/trunk/project

会提示“无法识别的 url 方案(一般需要 svn://,http://,file:///等开头)“http://192.168.1.101…”

Ps:如果是按照文章开始的方法安装,应该不会出现这个问题。

解决办法:安装 neon 让 svn 来支持 http 和 https 方式

1
2
3
4
5
6
wget http://www.webdav.org/neon/neon-0.29.6.tar.gz tar
tar zxvf neon-0.29.6.tar.gz tar
cd neon-0.29.6
./configure --prefix=/usr/local/neon --with-ssl=openssl
make
make install