一、svn服务器搭建(centos)
[root@VM-0-14-centos ~]# cd /home
[root@VM-0-14-centos home]# mkdir svn
[root@VM-0-14-centos home]# yum install subversion
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root@VM-0-14-centos home]#
[root@VM-0-14-centos home]# yum install subversion
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root@VM-0-14-centos home]# rpm -qa | grep subversion
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages database in /var/lib/rpm
[root@VM-0-14-centos home]#
[root@VM-0-14-centos home]# rpm -qa | grep subversion
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages database in /var/lib/rpm
[root@VM-0-14-centos home]#
[root@VM-0-14-centos home]# ls
sonar svn www
[root@VM-0-14-centos home]#
[root@VM-0-14-centos home]# ls
sonar svn www
[root@VM-0-14-centos home]# cd svn
[root@VM-0-14-centos svn]# ls
[root@VM-0-14-centos svn]#
[root@VM-0-14-centos svn]# yum -y install subversion
error: rpmdb: BDB0113 Thread/process 11823/140080699123776 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root@VM-0-14-centos svn]# cd /var/lib/rpm
[root@VM-0-14-centos rpm]# rm -rf __db*
[root@VM-0-14-centos rpm]# rpm --rebuilddb
[root@VM-0-14-centos rpm]# yum -y install subversion
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repository epel is listed more than once in the configuration
Determining fastest mirrors
docker-ce-stable | 3.5 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
os | 3.6 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/6): epel/7/x86_64/group_gz | 95 kB 00:00:00
(2/6): docker-ce-stable/x86_64/primary_db | 55 kB 00:00:00
(3/6): epel/7/x86_64/updateinfo | 1.0 MB 00:00:00
(4/6): extras/7/x86_64/primary_db | 224 kB 00:00:00
(5/6): epel/7/x86_64/primary_db | 6.9 MB 00:00:00
(6/6): updates/7/x86_64/primary_db | 5.6 MB 00:00:01
Resolving Dependencies
--> Running transaction check
---> Package subversion.x86_64 0:1.7.14-16.el7 will be installed
--> Processing Dependency: subversion-libs(x86-64) = 1.7.14-16.el7 for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_wc-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_subr-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_repos-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_ra_svn-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_ra_neon-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_ra_local-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_ra-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_fs_util-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_fs_fs-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_fs_base-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_fs-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_diff-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_delta-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libsvn_client-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libneon.so.27()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-1.7.14-16.el7.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package neon.x86_64 0:0.30.0-4.el7 will be installed
--> Processing Dependency: libgnutls.so.28(GNUTLS_3_0_0)(64bit) for package: neon-0.30.0-4.el7.x86_64
--> Processing Dependency: libgnutls.so.28(GNUTLS_2_12)(64bit) for package: neon-0.30.0-4.el7.x86_64
--> Processing Dependency: libgnutls.so.28(GNUTLS_1_4)(64bit) for package: neon-0.30.0-4.el7.x86_64
--> Processing Dependency: libpakchois.so.0()(64bit) for package: neon-0.30.0-4.el7.x86_64
--> Processing Dependency: libgnutls.so.28()(64bit) for package: neon-0.30.0-4.el7.x86_64
---> Package subversion-libs.x86_64 0:1.7.14-16.el7 will be installed
--> Running transaction check
---> Package gnutls.x86_64 0:3.3.29-9.el7_6 will be installed
--> Processing Dependency: trousers >= 0.3.11.2 for package: gnutls-3.3.29-9.el7_6.x86_64
--> Processing Dependency: libnettle.so.4()(64bit) for package: gnutls-3.3.29-9.el7_6.x86_64
--> Processing Dependency: libhogweed.so.2()(64bit) for package: gnutls-3.3.29-9.el7_6.x86_64
---> Package pakchois.x86_64 0:0.4-10.el7 will be installed
--> Running transaction check
---> Package nettle.x86_64 0:2.7.1-8.el7 will be installed
---> Package trousers.x86_64 0:0.3.14-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================
Installing:
subversion x86_64 1.7.14-16.el7 os 1.0 M
Installing for dependencies:
apr x86_64 1.4.8-7.el7 os 104 k
apr-util x86_64 1.5.2-6.el7 os 92 k
gnutls x86_64 3.3.29-9.el7_6 os 680 k
neon x86_64 0.30.0-4.el7 os 166 k
nettle x86_64 2.7.1-8.el7 os 327 k
pakchois x86_64 0.4-10.el7 os 14 k
subversion-libs x86_64 1.7.14-16.el7 os 922 k
trousers x86_64 0.3.14-2.el7 os 289 k
Transaction Summary
===================================================================================================================================================================
Install 1 Package (+8 Dependent packages)
Total download size: 3.5 M
Installed size: 12 M
Downloading packages:
(1/9): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00
(2/9): apr-1.4.8-7.el7.x86_64.rpm | 104 kB 00:00:00
(3/9): neon-0.30.0-4.el7.x86_64.rpm | 166 kB 00:00:00
(4/9): gnutls-3.3.29-9.el7_6.x86_64.rpm | 680 kB 00:00:00
(5/9): pakchois-0.4-10.el7.x86_64.rpm | 14 kB 00:00:00
(6/9): nettle-2.7.1-8.el7.x86_64.rpm | 327 kB 00:00:00
(7/9): subversion-1.7.14-16.el7.x86_64.rpm | 1.0 MB 00:00:00
(8/9): subversion-libs-1.7.14-16.el7.x86_64.rpm | 922 kB 00:00:00
(9/9): trousers-0.3.14-2.el7.x86_64.rpm | 289 kB 00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.0 MB/s | 3.5 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-7.el7.x86_64 1/9
Installing : apr-util-1.5.2-6.el7.x86_64 2/9
Installing : pakchois-0.4-10.el7.x86_64 3/9
Installing : nettle-2.7.1-8.el7.x86_64 4/9
Installing : trousers-0.3.14-2.el7.x86_64 5/9
Installing : gnutls-3.3.29-9.el7_6.x86_64 6/9
Installing : neon-0.30.0-4.el7.x86_64 7/9
Installing : subversion-libs-1.7.14-16.el7.x86_64 8/9
Installing : subversion-1.7.14-16.el7.x86_64 9/9
Verifying : trousers-0.3.14-2.el7.x86_64 1/9
Verifying : apr-1.4.8-7.el7.x86_64 2/9
Verifying : subversion-1.7.14-16.el7.x86_64 3/9
Verifying : apr-util-1.5.2-6.el7.x86_64 4/9
Verifying : subversion-libs-1.7.14-16.el7.x86_64 5/9
Verifying : nettle-2.7.1-8.el7.x86_64 6/9
Verifying : neon-0.30.0-4.el7.x86_64 7/9
Verifying : pakchois-0.4-10.el7.x86_64 8/9
Verifying : gnutls-3.3.29-9.el7_6.x86_64 9/9
Installed:
subversion.x86_64 0:1.7.14-16.el7
Dependency Installed:
apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7 gnutls.x86_64 0:3.3.29-9.el7_6 neon.x86_64 0:0.30.0-4.el7 nettle.x86_64 0:2.7.1-8.el7
pakchois.x86_64 0:0.4-10.el7 subversion-libs.x86_64 0:1.7.14-16.el7 trousers.x86_64 0:0.3.14-2.el7
Complete!
[root@VM-0-14-centos rpm]#
[root@VM-0-14-centos rpm]# svnadmin create /home/svn
[root@VM-0-14-centos rpm]# cd /home/svn
[root@VM-0-14-centos svn]# ls
conf db format hooks locks README.txt
[root@VM-0-14-centos svn]# cd conf
[root@VM-0-14-centos conf]# ls
authz passwd svnserve.conf
[root@VM-0-14-centos conf]#
[root@VM-0-14-centos conf]# ls
authz passwd svnserve.conf
[root@VM-0-14-centos conf]#
[root@VM-0-14-centos conf]# svnserve -d -r /home/svn
[root@VM-0-14-centos conf]# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 18255/svnserve
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1308/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1224/sshd
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 20092/python
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1333/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1308/nginx: master
tcp6 0 0 :::2375 :::* LISTEN 8235/dockerd
tcp6 0 0 :::7946 :::* LISTEN 8235/dockerd
tcp6 0 0 :::6379 :::* LISTEN 21200/docker-proxy
tcp6 0 0 ::1:25 :::* LISTEN 1333/master
tcp6 0 0 :::8090 :::* LISTEN 16166/java
udp 0 0 0.0.0.0:4789 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* 939/dhclient
udp 0 0 172.21.0.14:123 0.0.0.0:* 570/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 570/ntpd
udp6 0 0 :::7946 :::* 8235/dockerd
udp6 0 0 fe80::5054:ff:fe8b::123 :::* 570/ntpd
udp6 0 0 ::1:123 :::* 570/ntpd
修改conf文件夹下配置
passwd文件配置账号密码
[users]
lihaijian=lihaijian123
test=test123
authz配置读写权限
[/]
lihaijian=rw
test=r
*=
svnserve.conf配置仓库位置,是否使用密码等配置
anon-access = read #匿名用户可读
auth-access = write #授权用户可写
password-db = passwd #使用哪个文件作为账号文件
authz-db = authz #使用哪个文件作为权限文件
realm = /home/svn # 认证空间名,版本库所在目录
二、svn客户端
TortoiseSVN官网
下载完成后一路next即可
三、svm使用
3.1 添加文件、文件夹
3.2 提交文件(svn Commit)
3.3 同步仓库(svn update)![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3ca7bd17c82e615657cc491b4d2d489e.png)
参考文章:Linux下安装SVN服务端小白教程