≡ Menu

How to Install CVS and Create CVS Repository on Linux Server

Question: How do I install CVS server, and create a CVS repository on UNIX / Linux environment to manage my source codes?

Answer: You should really be using subversion or GIT. For some reason, if you still want to install and configure CVS, use the steps explained below.

1. Verify CVS

Make sure your Linux server has cvs installed as shown below.

# cvs -v
Concurrent Versions System (CVS) 1.11.22 (client/server)
Copyright (C) 2006 Free Software Foundation, Inc.

If you don’t have CVS installed on your system, install it from your Linux distribution repository. For example, on redhat based system, install the RPM as shown below.

# rpm -ivh cvs-1.11.22-5.el5.i386.rpm

2. Create CVS User and Groups

Create cvs user as shown below.

# useradd cvs

# passwd cvs

If you want only developers to access the CVS repository, create a developers group as shown below.

# groupadd developers

3. Create CVS Repository Directory

If you are planning to create a CVS repository for project1, create the following /home/cvs/project1 directory and assign appropriate privileges.

$ cd /home/cvs

$ mkdir project1

As root, do the following to assign developers group to this directory, also make sure group has full privilege on this project1 directory.

# chgrp developers /home/cvs/project1/

# chmod g+srwx /home/cvs/project1

4. Initialize the CVS Repository

Currently the /home/cvs/project1 is just an empty directory. To make this as a CVS repository, you should initialize it as shown below.

$ cvs -d /home/cvs/project1 init

Once initialized, you’ll see CVSROOT directory created under the CVS repository.

$ ls -la /home/cvs/project1/
total 12
drwxrwxr-x 3 cvs developers 3096 Aug 21 15:11 .
drwx------ 4 cvs cvs        3096 Aug 21 15:10 ..
drwxrwxr-x 3 cvs cvs        3096 Aug 21 15:11 CVSROOT

Now you can start checking in your source code to the /home/cvs/project1 CVS repository.

Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • Abhijeet October 7, 2011, 4:11 am

    Hi,
    I am looking for installation for git server on ubuntu ?
    Could you please provide tutorial for git server ?
    btw, nice article.

  • Sigurdur Jonsson October 7, 2011, 4:37 am

    Hi,
    Nice tutorial but a bit short. Could you give examples on how to push code to the repository, and pull it from the repo. Also how to create a branch etc. Basic cvs stuff for programmers which I am not by the way, but you can use revision control systems for other kinds of documents.

    Thanks in advance,
    Siggi

    P.s. love your blog.

  • Sigurdur Jonsson October 7, 2011, 4:41 am

    Try this link. The search form on this page doesn’t work.

    http://www.thegeekstuff.com/2011/08/git-install-configure/

  • Ofloo October 9, 2011, 1:08 am

    You point out we really should be using git or svn, however you don’t explain why that is.

  • Biswajit March 21, 2014, 4:41 am

    “rpm -qa | grep cvs ” displays cvs-1.11.23-15.el6.i686