![无需 root 安装 Subversion(1.8.13)](https://linux22.com/image/1454595/%E6%97%A0%E9%9C%80%20root%20%E5%AE%89%E8%A3%85%20Subversion%EF%BC%881.8.13%EF%BC%89.png)
我想在没有 root 权限的情况下安装较新版本的 svn。在 ubuntu 上,apt-get 版本是:
svn --version
svn,版本 1.8.8(r1568071)
但我想安装较新的版本subversion-1.8.13
。
我正在执行此操作的服务器尚未安装 apr、apr-util,为此,我还在独立服务器上安装了它们:
cd $HOME
mkdir custom_installed
cd custom_installed
# Install apr
wget ftp://mirror.switch.ch/mirror/apache/dist//apr/apr-1.5.2.tar.gz
tar xvfz apr-1.5.2.tar.gz
cd apr-1.5.2
./configure —prefix=$HOME/custom_installed
make
make test
make install
cd ..
# Install apu
wget ftp://mirror.switch.ch/mirror/apache/dist//apr/apr-util-1.5.4.tar.gz
tar xvfz apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=$HOME/custom_installed --with-apr=$HOME/custom_installed
make
make test
make install
cd ..
它似乎已正确安装在 custom_installed 上,它具有以下 include、lib 和 bin 档案:
ls lib
apr.exp aprutil.exp libapr-1.la libapr-1.so.0
libaprutil-1.a libaprutil-1.so libaprutil-1.so.0.5.4 apr-util-1 libapr-1.a libapr-1.so libapr-1.so.0.5.2 libaprutil-1.la libaprutil-1.so.0 pkgconfig
ls include/apr-1
apr_allocator.h apr_dbm.h apr_general.h apr_ldap_init.h apr_mmap.h apr_queue.h apr_signal.h
apr_thread_pool.h apr_want.h apr_anylock.h apr_dso.h
apr_getopt.h apr_ldap_option.h apr_network_io.h
apr_random.h apr_skiplist.h apr_thread_proc.h apr_xlate.h apr_atomic.h apr_env.h apr_global_mutex.h apr_ldap_rebind.h apr_optional.h apr_reslist.h apr_strings.h apr_thread_rwlock.h apr_xml.h apr_base64.h apr_errno.h apr.h apr_ldap_url.h apr_optional_hooks.h apr_ring.h apr_strmatch.h apr_time.h apu_errno.h apr_buckets.h apr_escape.h
apr_hash.h apr_lib.h apr_poll.h apr_rmm.h apr_support.h apr_uri.h apu.h apr_crypto.h apr_file_info.h
apr_hooks.h apr_md4.h apr_pools.h
apr_sdbm.h apr_tables.h apr_user.h apu_version.h apr_date.h apr_file_io.h apr_inherit.h apr_md5.h apr_portable.h apr_sha1.h
apr_thread_cond.h apr_uuid.h
apu_want.h apr_dbd.h apr_fnmatch.h apr_ldap.h
apr_memcache.h apr_proc_mutex.h apr_shm.h
apr_thread_mutex.h apr_version.h
ls bin
apr-1-配置 apu-1-配置
但是,当我尝试安装 svn 时,可以使用 tarball:
wget http://apache.claz.org/subversion/subversion-1.8.13.tar.gz
tar xvfz subversion-1.8.13.tar.gz
cd subversion-1.8.13
wget http://www.sqlite.org/sqlite-amalgamation-3071501.zip
unzip sqlite-amalgamation-3071501.zip
mv sqlite-amalgamation-3071501 sqlite-amalgamation
./configure --prefix=$HOME/custom_installed --with-apr=$HOME/custom_installed --with-apr-util=$HOME/custom_installed
make
或者 svn trunk:
svn co https://svn.apache.org/repos/asf/subversion/trunk svn
cd svn
# get SQLite amalgamation if required
chmod +x autogen.sh
./autogen.sh
wget http://www.sqlite.org/sqlite-amalgamation-3071501.zip
unzip sqlite-amalgamation-3071501.zip
mv sqlite-amalgamation-3071501 sqlite-amalgamation
./configure —prefix=$HOME/custom_installed --with-apr=$HOME/custom_installed --with-apr-util=$HOME/custom_installed
make
我一直收到这个错误:
libtool:链接:警告:库
/home/wsfreund/custom_installed/lib/libapr-1.la' was moved. /bin/sed: can't read /usr/local/apr/lib/libapr-1.la: No such file or directory libtool: link:
/usr/local/apr/lib/libapr-1.la' 不是有效的 libtool 档案 make:*** [subversion/libsvn_subr/libsvn_subr-1.la] 错误 1
链接期间:
cd subversion/libsvn_subr && /bin/bash "/home/wsfreund/custom_installed/svn/libtool" --tag=CC --silent --mode=link gcc -g -O2 -g -O2 -pthread -rpath /home/wsfreund/custom_installed/lib -version-info 0 -Wl,--no-undefined -o libsvn_subr-1.la adler32.lo atomic.lo auth.lo base64.lo bit_array.lo cache-inprocess.lo cache-membuffer.lo cache-memcache.lo cache.lo cache_config.lo checksum.lo cmdline.lo compat.lo compress.lo config.lo config_auth.lo config_file.lo config_win.lo crypto.lo ctype.lo date.lo debug.lo deprecated.lo dirent_uri.lo dso.lo eol.lo error.lo fnv1a.lo gpg_agent.lo hash.lo io.lo iter.lo lock.lo log.lo macos_keychain.lo magic.lo md5.lo mergeinfo.lo mutex.lo nls.lo object_pool.lo opt.lo packed_data.lo path.lo pool.lo prefix_string.lo prompt.lo properties.lo quoprint.lo root_pools.lo simple_providers.lo skel.lo sorts.lo spillbuf.lo sqlite.lo sqlite3wrapper.lo ssl_client_cert_providers.lo ssl_client_cert_pw_providers.lo ssl_server_trust_providers.lo stream.lo string.lo subst.lo sysinfo.lo target.lo temp_serializer.lo time.lo token.lo types.lo user.lo username_providers.lo utf.lo utf8proc.lo utf_validate.lo utf_width.lo validate.lo version.lo win32_crashrpt.lo win32_crypto.lo win32_xlate.lo x509info.lo x509parse.lo xml.lo -L/home/wsfreund/custom_installed/lib -laprutil-1 -L/home/wsfreund/custom_installed/lib -lapr-1 -lexpat -lz -ldl -lpthread
最奇怪的是,我一点头绪都没有为什么它希望在 上找到它/usr/local/apr/lib/libapr-1.la
,因为它应该在 上找到它/home/wsfreund/custom_installed/lib
……
添加更多信息:
/home/wsfreund/custom_installed/svn/libtool --tag=CC --mode=link gcc -g -O2 -g -O2 -pthread -rpath /home/wsfreund/custom_installed/lib -version-info 0 -Wl,--no-undefined -o libsvn_subr-1.la adler32.lo atomic.lo auth.lo base64.lo bit_array.lo cache-inprocess.lo cache-membuffer.lo cache-memcache.lo cache.lo cache_config.lo checksum.lo cmdline.lo compat.lo compress.lo config.lo config_auth.lo config_file.lo config_win.lo crypto.lo ctype.lo date.lo debug.lo deprecated.lo dirent_uri.lo dso.lo eol.lo error.lo fnv1a.lo gpg_agent.lo hash.lo io.lo iter.lo lock.lo log.lo macos_keychain.lo magic.lo md5.lo mergeinfo.lo mutex.lo nls.lo object_pool.lo opt.lo packed_data.lo path.lo pool.lo prefix_string.lo prompt.lo properties.lo quoprint.lo root_pools.lo simple_providers.lo skel.lo sorts.lo spillbuf.lo sqlite.lo sqlite3wrapper.lo ssl_client_cert_providers.lo ssl_client_cert_pw_providers.lo ssl_server_trust_providers.lo stream.lo string.lo subst.lo sysinfo.lo target.lo temp_serializer.lo time.lo token.lo types.lo user.lo username_providers.lo utf.lo utf8proc.lo utf_validate.lo utf_width.lo validate.lo version.lo win32_crashrpt.lo win32_crypto.lo win32_xlate.lo x509info.lo x509parse.lo xml.lo -L/home/wsfreund/custom_installed/lib -laprutil-1 -L/home/wsfreund/custom_installed/lib -lapr-1 -lexpat -lz -ldl -lpthread --debug --config
libtool:链接:警告:库“/home/wsfreund/custom_installed/lib/libapr-1.la”已被移动。
libtool: link: rm -fr .libs/libsvn_subr-1.a .libs/libsvn_subr-1.so .libs/libsvn_subr-1.so.0 .libs/libsvn_subr-1.so.0.0.0
libtool: link: gcc -shared -fPIC -DPIC .libs/adler32.o .libs/atomic.o .libs/auth.o .libs/base64.o .libs/bit_array.o .libs/cache-inprocess.o .libs/cache-membuffer.o .libs/cache-memcache.o .libs/cache.o .libs/cache_config.o .libs/checksum.o .libs/cmdline.o .libs/compat.o .libs/compress.o .libs/config.o .libs/config_auth.o .libs/config_file.o .libs/config_win.o .libs/crypto.o .libs/ctype.o .libs/date.o .libs/debug.o .libs/deprecated.o .libs/dirent_uri.o .libs/dso.o .libs/eol.o .libs/error.o .libs/fnv1a.o .libs/gpg_agent.o .libs/hash.o .libs/io.o .libs/iter.o .libs/lock.o .libs/log.o .libs/macos_keychain.o .libs/magic.o .libs/md5.o .libs/mergeinfo.o .libs/mutex.o .libs/nls.o .libs/object_pool.o .libs/opt.o .libs/packed_data.o .libs/path.o .libs/pool.o .libs/prefix_string.o .libs/prompt.o .libs/properties.o .libs/quoprint.o .libs/root_pools.o .libs/simple_providers.o .libs/skel.o .libs/sorts.o .libs/spillbuf.o .libs/sqlite.o .libs/sqlite3wrapper.o .libs/ssl_client_cert_providers.o .libs/ssl_client_cert_pw_providers.o .libs/ssl_server_trust_providers.o .libs/stream.o .libs/string.o .libs/subst.o .libs/sysinfo.o .libs/target.o .libs/temp_serializer.o .libs/time.o .libs/token.o .libs/types.o .libs/user.o .libs/username_providers.o .libs/utf.o .libs/utf8proc.o .libs/utf_validate.o .libs/utf_width.o .libs/validate.o .libs/version.o .libs/win32_crashrpt.o .libs/win32_crypto.o .libs/win32_xlate.o .libs/x509info.o .libs/x509parse.o .libs/xml.o -Wl,-rpath -Wl,/home/wsfreund/custom_installed/lib -Wl,-rpath -Wl,/home/wsfreund/custom_installed/lib -L/home/wsfreund/custom_installed/lib /home/wsfreund/custom_installed/lib/libaprutil-1.so /home/wsfreund/custom_installed/lib/libapr-1.so /usr/lib/x86_64-linux-gnu/libexpat.so -lz -ldl -lpthread -O2 -O2 -pthread -Wl,--no-undefined -pthread -Wl,-soname -Wl,libsvn_subr-1.so.0 -o .libs/libsvn_subr-1.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libsvn_subr-1.so.0" && ln -s "libsvn_subr-1.so.0.0.0" "libsvn_subr-1.so.0")
libtool: link: (cd ".libs" && rm -f "libsvn_subr-1.so" && ln -s "libsvn_subr-1.so.0.0.0" "libsvn_subr-1.so")
libtool: link: ar cru .libs/libsvn_subr-1.a adler32.o atomic.o auth.o base64.o bit_array.o cache-inprocess.o cache-membuffer.o cache-memcache.o cache.o cache_config.o checksum.o cmdline.o compat.o compress.o config.o config_auth.o config_file.o config_win.o crypto.o ctype.o date.o debug.o deprecated.o dirent_uri.o dso.o eol.o error.o fnv1a.o gpg_agent.o hash.o io.o iter.o lock.o log.o macos_keychain.o magic.o md5.o mergeinfo.o mutex.o nls.o object_pool.o opt.o packed_data.o path.o pool.o prefix_string.o prompt.o properties.o quoprint.o root_pools.o simple_providers.o skel.o sorts.o spillbuf.o sqlite.o sqlite3wrapper.o ssl_client_cert_providers.o ssl_client_cert_pw_providers.o ssl_server_trust_providers.o stream.o string.o subst.o sysinfo.o target.o temp_serializer.o time.o token.o types.o user.o username_providers.o utf.o utf8proc.o utf_validate.o utf_width.o validate.o version.o win32_crashrpt.o win32_crypto.o win32_xlate.o x509info.o x509parse.o xml.o
libtool: link: ranlib .libs/libsvn_subr-1.a
/bin/sed:无法读取 /usr/local/apr/lib/libapr-1.la:没有此文件或目录 libtool:链接:`/usr/local/apr/lib/libapr-1.la' 不是有效的 libtool 存档
这也报告给[email protected]
答案1
按照Stack Overflow 上的这个问题,这两个.la
文件(libapr-1.la
和libaprutil-1.la
)都描述了库本身,应该进行注释。这些文件中引用的路径可能不正确或默认为系统的LD_LIBRARY_PATH
。
使用文本编辑器编辑这两个文件,并更新相应的路径以指向新编译的库二进制文件,应该可以解决该问题。有关要进行的更改的具体细节如下所述。
如果问题仍然存在,则进一步Stack Overflow 上的问题可能会有所帮助。您可以手动将本地编译的库添加到LD_LIBRARY_PATH
临时库中,或者通过编辑(或任何构建脚本)-rpath
为任何调用设置标志,以覆盖默认共享库路径。gcc
Makefile
使用文本编辑器编辑这两个文件,并更新相应的路径以指向新编译的库二进制文件,应该可以解决问题。在这个特定情况下,需要更改以下文件:
41
文件行libapr-1.la
:
libdir='/usr/local/apr/lib' # change to your installation path
并排:20
libaprutil-1.la
dependency_libs=' /usr/lib/x86_64-linux-gnu/libexpat.la /usr/local/apr/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl' # change libapr-1.la path to the correct one
之后,请确保通过执行以下操作重置安装配置文件(使./configure 适应您的正确路径和需求):
make clean
./configure —prefix=$HOME/custom_installed --with-apr=$HOME/custom_installed/bin/apr-1-config --with-apr-util=$HOME/custom_installed/bin/apu-1-config