Reference:
https://archive.apache.org/dist/subversion/
http://www.2cto.com/os/201501/369067.html
http://www.68idc.cn/help/server/linux/20141227150488.html
Ubuntu14.10安裝subversion版本
安裝了ubuntu-14.10版本後發現預設安裝subversion 1.8. 而1.8版本與目前XP上使用的1.6版本無法相容,網上搜尋了下發現使用1.8版本的人並不多,為了避免開發環境切換帶來的開銷,暫不想將XP下也升級到1.8. 那隻能ubuntu上安裝1.6.
1.下載subversion-1.6.17.tar.gz
http://download.csdn.net/detail/sunwill_chen/8354589
2.下載subversion-deps-1.6.17.tar.bz2
http://download.csdn.net/detail/sunwill_chen/8354593
3.#apt-get install gcc make libssl-dev libexpat1-dev
4.#tar xvf subversion-1.6.17.tar.gz
5.#tar xvf subversion-deps-1.6.17.tar.bz2
6.#cd subversion-1.6.17
7.#./configure
8.#make && make install
9.#ln -s /usr/lib/i386-linux-gnu/libexpat.so /usr/lib/i386-linux-gnu/libexpat.so.0
10.查看svn版本號碼:
# svn --version
svn, version 1.6.17 (r1128011)
compiled Jan 12 2015, 20:05:45
問題:
1.configure: error: no XML parser was found: expat or libxml 2.x required
解決:apt-get install libxml2-dev
(注: 這個可以不需要安裝,後面安裝了libexpat1-dev才真正起作用)
2.make最後出現錯誤:
/home/tools/subversion-1.6.17/subversion/libsvn_ra_neon/.libs/libsvn_ra_neon-1.so: undefined reference to `xmlFreeParserCtxt'
/home/tools/subversion-1.6.17/subversion/libsvn_ra_neon/.libs/libsvn_ra_neon-1.so: undefined reference to `xmlParseChunk'
/home/tools/subversion-1.6.17/subversion/libsvn_ra_neon/.libs/libsvn_ra_neon-1.so: undefined reference to `xmlCreatePushParserCtxt'
collect2: error: ld returned 1 exit status
解決:經過分析代碼發現沒有EXPAT才會有這個問題,因為安裝expat,
#apt-get install libexpat1-dev
3.運行svn發現庫連結錯誤,
svn: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory
解決:使用dpkg -L libexpat1-dev安裝在哪個目錄,一看沒有這個檔案,做個軟連結即可。
#ln -s /usr/lib/i386-linux-gnu/libexpat.so /usr/lib/i386-linux-gnu/libexpat.so.0
KUbuntu/Ubuntu 14.04 (降級)安裝 SVN 1.7
Step 1: 增加源到 source.list
sudo add-apt-repository "deb http://extras.ubuntu.com/ubuntu saucy main"
sudo add-apt-repository "deb http://de.archive.ubuntu.com/ubuntu/ saucy main universe restricted multiverse"
Step 2: 刪除 svn 1.8 package
sudo apt-get remove subversion libsvn1
Step 3: 更新源
sudo apt-get update
Step 4: 安裝 svn 1.7
sudo apt-get install subversion=1.7.9-1+nmu6ubuntu3 libsvn1=1.7.9-1+nmu6ubuntu3 subversion-tools=1.7.9-1+nmu6ubuntu3
Step 5: 鎖定 SVN to 1.7 to 防止自動升級
echo subversion hold | sudo dpkg --set-selections
echo libsvn1 hold | sudo dpkg --set-selections
echo libserf1 hold | sudo dpkg --set-selections
Step 6: 從源sources.list中移除 Step 1 增加的行
sudo gedit /etc/apt/sources.list
移除:deb http://extras.ubuntu.com/ubuntu saucy main
移除:deb http://de.archive.ubuntu.com/ubuntu/ saucy main universe restricted multiverse
Step 7: 更新源
sudo apt-get update
Step 8: 查看svn版本
svn --version
~$ svn --version
svn,版本 1.7.9 (r1462340)
編譯於 Oct 15 2013,12:40:34
Copyright (C) 2013 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/
可使用以下的版本庫訪問模組:
* ra_neon : 通過 WebDAV 協議使用 neon 訪問版本庫的模組。
- 處理“http”方案
- 處理“https”方案
* ra_svn : 使用 svn 網路通訊協定訪問版本庫的模組。 - 使用 Cyrus SASL 認證
- 處理“svn”方案
* ra_local : 訪問本地磁碟的版本庫模組。
- 處理“file”方案
* ra_serf : 通過 WebDAV 協議使用 serf 訪問版本庫的模組。
- 處理“http”方案
- 處理“https”方案