Answers:
从Ubuntu 12.10开始,Subversion 1.7作为发行版的一部分提供。可以使用apt-get安装Subversion。
sudo apt-get install subversion
对于早期版本的Ubuntu,在subversion-1.7处有一个ppa可用。可以按以下方式添加存储库:
sudo apt-add-repository ppa:dominik-stadler/subversion-1.7
要获取最新版本的Subversion,请更新并升级存储库。
sudo apt-get update
sudo apt-get upgrade
我还需要进行远程升级。
sudo apt-get dist-upgrade
我假设您已经安装了Subversion,如果没有安装的话:
sudo apt-get install subversion
svn cleanup [repo]
从1.6升级之前不要忘记升级,因为svn 1.7客户端不会清理较旧的存储库。升级svn客户端后,运行svn upgrade [repo]
以升级每个存储库的元数据。更多详细信息stackoverflow.com/a/7754776/114900
Subversion小组也直接支持一个PPA:“ Subversion”小组。
您应该可以使用以下命令添加ppa:
sudo apt-add-repository ppa:svn/ppa
apt-add-repository命令由python-software-properties软件包提供,因此请确保先安装它。
注意:RabbitVCS似乎在Subversion 1.7中存在问题:Rabbitvcs在svn 1.7中没有标记为版本化的subfodlers /文件。它已固定在后备箱中,但尚未(尚未)推送到构建中。
Wandisco脚本实际上安装了一个新的存储库,其中包含用于安装SVN 1.7的.deb文件。
通过执行以下命令几乎可以完成:
sudo add-apt-repository 'deb http://opensource.wandisco.com/ubuntu lucid svn17'
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install subversion
sudo: add-apt-repository: command not found
错误消息,则需要安装python-software-properties:sudo apt-get install python-software-properties
lucid
而不是您的实际发行版名称。他们仅提供的发布lucid
。并确保删除/注释掉对应的deb-src
行(/etc/apt/sources.list
如果有的话)。
使用Trac时使用WANdisco存储库升级Subversion后,您可能会注意到一个问题。其症状是Trac站点中的一条消息:
警告:无法与存储库“(默认)”同步(不受支持的版本控制系统“ svn”:没有名为svn的模块)。在Trac日志中查找更多信息。
该软件包将svn绑定到python2.6,而Ubuntu 12.04具有python2.7。这是一个脚本,它解决了我这方面的问题:
mkdir /usr/lib/python2.7/dist-packages/libsvn
for f in /usr/lib/pyshared/python2.6/libsvn/*; do ln -s $f /usr/lib/python2.7/dist-packages/libsvn/; done
for f in /usr/share/pyshared/libsvn/*; do ln -s $f /usr/lib/python2.7/dist-packages/libsvn/; done
mkdir /usr/lib/python2.7/dist-packages/svn
for f in /usr/share/pyshared/svn/*; do ln -s $f /usr/lib/python2.7/dist-packages/svn/; done
mkdir /usr/lib/pyshared/python2.7/libsvn
for f in /usr/lib/pyshared/python2.6/libsvn/*; do ln -s $f /usr/lib/pyshared/python2.7/libsvn/; done
正如Fernando所描述的,我已经使用了wandisco二进制文件和apt源码,但是现在下一个Ubuntu版本的官方二进制文件已更新为1.7,我想在坚持12.04 LTS的同时使用它们。
将以下源添加到新文件/etc/apt/sources.list.d/svn17.list:
deb http://archive.ubuntu.com/ubuntu/ quantal main universe
deb-src http://archive.ubuntu.com/ubuntu/ quantal main universe
然后根据https://help.ubuntu.com/community/PinningHowto对/etc/apt/apt.conf.d/90svn17的建议:
APT::Default-Release "precise";
然后安装使用
sudo apt-get install -V subversion -t quantal
不知道这些新文件名是否遵循正确的约定,但是可以正常工作。尝试过固定配置,但没有运气。使用“ -t定量”时,不需要固定。
不相信有任何可用的公共.deb。您可以尝试使用此脚本从WANdisco安装1.7
svn1.7_ubuntu_wandisco.sh
#!/bin/bash +x
# WANdisco Subversion Installer V0.1
# opensource@wandisco.com
echo WANdisco Subversion Installer v0.1 for Ubuntu 9.10, 10.04, 10.10
echo Please report problems and bugs to opensource@wandisco.com
echo
echo Gathering some information about your system...
MINVERSION='1'
SVNVER='1.7.0'
ARCH=`uname -m`
SVNSTATUS=`dpkg -l|grep " libsvn1 " | awk '{print $1}'`
#functions
check_is_root ()
{
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
}
svn_remove_old ()
{
echo Removing old packages...
apt-get -y remove libsvn1 subversion libapache2-svn libsvn-dev libsvn-doc libsvn-perl subversion-tools
}
add_repo_config ()
{
echo Adding repository configuration to /etc/apt/sources.list.d/
if [ -f /etc/apt/sources.list.d/WANdisco.list ]; then
rm /etc/apt/sources.list.d/WANdisco.list
fi
echo "Installing Apt repo...."
echo "# WANdisco Open Source Repo" > /etc/apt/sources.list.d/WANdisco.list
echo "deb http://opensource.wandisco.com/ubuntu lucid svn17" >> /etc/apt/sources.list.d/WANdisco.list
echo "Importing GPG key"
wget http://opensource.wandisco.com/wandisco-debian.gpg -O /tmp/wandisco-debian.gpg &>/dev/null
apt-key add /tmp/wandisco-debian.gpg
rm -rf /tmp/wandisco-debian.gpg
apt-get update
}
install_svn ()
{
echo Checking to see if you already have Subversion installed via dpkg...
if [ "$SVNSTATUS" == "ii" ]; then
echo
echo Subversion is already installed on the system.
echo Do you wish to replace the version of subversion currently installed with the WANdisco version?
echo This action will remove the previous version from your system.
echo -n "[y/N]: "
read svn_install_confirm
if [ "$svn_install_confirm" == "y" -o "$svn_install_confirm" == "Y" ]; then
svn_remove_old
add_repo_config
echo
echo Installing Subversion $SVNVER-$MINVERSION
echo
apt-get -y --force-yes install subversion libsvn-perl subversion-tools
echo -n "Would you like to install apache and the apache SVN modules? [y/N] "
read dav_svn_confirm
if [ "$dav_svn_confirm" == "y" -o "$dav_svn_confirm" == "Y" ]; then
echo Installing apache and subversion modules
apt-get -y --force-yes install apache2 libapache2-svn
echo -n "Installation complete. Restart apache? [y/N] "
read apache_restart_confirm
if [ $apache_restart_confirm == "y" -o $apache_restart_confirm == "Y" ]; then
/etc/init.d/apache2 restart
fi
fi
else
echo "Install Cancelled"
exit 1
fi
else
# Install SVN
echo "Subversion is not currently installed"
echo -n "Starting installation, are you sure you wish to continue? [y/N] "
read svn_install_confirm
if [ "$svn_install_confirm" == "y" -o "$svn_install_confirm" == "Y" ]; then
add_repo_config
echo
echo Installing Subversion $SVNVER-$MINVERSION
echo
apt-get -y --force-yes install subversion libsvn-perl subversion-tools
echo -n "Would you like to install apache and the apache SVN modules? [y/N] "
read dav_svn_confirm
if [ "$dav_svn_confirm" == "y" -o "$dav_svn_confirm" == "Y" ]; then
echo Installing apache and subversion modules
apt-get -y --force-yes install apache2 libapache2-svn libsvn-dev
echo -n "Installation complete. Restart apache? [y/N] "
read apache_restart_confirm
if [ $apache_restart_confirm == "y" -o $apache_restart_confirm == "Y" ]; then
/etc/init.d/apache2 restart
fi
fi
else
echo "Install Cancelled"
exit 1
fi
fi
}
install_32 ()
{
echo Installing for $ARCH
install_svn
}
install_64 ()
{
echo Installing for $ARCH
install_svn
}
#Main
check_is_root
echo Checking your system architecture.
if [ "$ARCH" == "i686" -o "$ARCH" == "i386" ]; then
install_32
elif [ "$ARCH" == "x86_64" ];
then
install_64
else
echo Unsupported platform: $ARCH
exit 1
fi