1.下载subversion、apr、apr-util、sqlite-amalgamation:
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.5.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/subversion/subversion-1.12.0.tar.gz
wget https://www.sqlite.org/2019/sqlite-amalgamation-3280000.zip
2.安装编译环境
yum install unzip openssh-clients zlib zlib-devel gcc-c++ expat-devel -y
3.编译安装apr、apr-util
tar -zxf apr-1.6.5.tar.gz
cd ./apr-1.6.5
./configure --prefix=/usr/local/apr && make && make install
tar -zxf apr-util-1.6.1.tar.gz
cd ./apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install
4.编译安装subversion
tar -zxf subversion-1.12.0.tar.gz
unzip sqlite-amalgamation-3280000.zip
mv sqlite-amalgamation-3280000 subversion-1.12.0/sqlite-amalgamation
注意:文件夹被重命名为sqlite-amalgamation,否则会报以下错误:
[sleeber@localhost subversion-1.12.0]$ mv sqlite-amalgamation-3280000 sqlite-amalgamation
mv: cannot stat `sqlite-amalgamation-3280000': No such file or directory
cd subversion-1.12.0
./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-zlib --enable-maintainer-mode
make
make install
这里需要注意./configure命令,这个命令作为编译配置有很多选项,如果失败,需要添加合适的选项,错误如下:
错误1:configure: error: Subversion requires LZ4 >= r129, or use --with-lz4=internal
解决:./configure命令添加 --with-lz4=internal选项
configure: error: Subversion requires LZ4 >= r129, or use --with-lz4=internal
[sleeber@localhost subversion-1.12.0]$ sudo ./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-zlib --enable-maintainer-mode --with-lz4=internal
错误2:configure: error: Subversion requires UTF8PROC
解决:./configure命令添加 --with-utf8proc=internal
configure: error: Subversion requires UTF8PROC
[sleeber@localhost subversion-1.12.0]$ sudo ./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-zlib --enable-maintainer-mode --with-lz4=internal --with-utf8proc=internal
make & make install
5.subversion添加到path
vim /etc/bashrc
export SVN_HOME=/usr/local/subversion
export PATH=$PATH:$SVN_HOME/bin
source /etc/bashrc
主要参考:https://blog.youkuaiyun.com/qq_27868061/article/details/81094187
本文详细介绍了如何在Linux环境下从源码编译安装Subversion版本控制系统,包括所需依赖的APR、APR-Util和SQLite的下载与安装过程,以及在编译Subversion时可能遇到的错误及其解决方案。
262

被折叠的 条评论
为什么被折叠?



