CVS CO Error

Giorgos Keramidas keramida at
Mon Sep 13 18:21:06 PDT 2004

On 2004-09-13 17:02, "Kenneth A. Bond" <fhb_1969 at> wrote:
> I am trying to update my source using CVS, as CVSup is not an option
> in my current environment. I am running FreeBSD 4.10.  Below are the
> commands that I am entering in order to perform the update, but for
> some reason, I am getting the following error when attempting to
> update my source:
> lx1005# pwd
> /usr/src
> lx1005# setenv CVSROOT anoncvs at
> lx1005# cvs co -rRELENG_4_10 src
> cvs [checkout aborted]: cannot write /home/ncvs/CVSROOT/val-tags: Permission denied
> lx1005# whoami
> root

*   Is /usr/src a source tree that you created with a `cvs checkout'?

    This should be obvious from the CVS/ subdirectories of all the directories
    in the /usr/src hierarchy.  If you don't have these CVS/ subdirectories
    you're probably trying to update with CVS a source tree that was created
    by CVSup.  This won't work.

*   The cvs checkout command is run in the wrong path.

    The checkout (or `co') command of CVS will create the directory you're
    checking out as a subdirectory of the current path.  So by running `cvs
    checkout src' in /tmp you'll create /tmp/src ... by running `cvs checkout
    src' in /usr/src you will get yourself `/usr/src/src' which is definitely

    The `cvs update' command, on the other hand, updates files starting with
    the current directory (unless told otherwise), so you'd have to be
    *INSIDE* /usr/src to update /usr/src.  The difference is subtle but very

*   To fix the ``cannot write /home/ncvs/CVSROOT/val-tags'' message run cvs
    with the -R option.

    When running against a remote repository, cvs should be run with -R, IMHO.
    This way, it will consider the repository read-only and avoid attempting
    to write files within it.

    Remote repositories might also require you to `cvs login' first (if you
    haven't logged in at least once in the past).

Bearing all this in mind, the correct sequence of commands to run in your case
would be:

a.  If /usr/src is a checkout and not a CVSup-created directory:

	# cd /usr/src
	# export CVSROOT='anoncvs at'
	# cvs login:
	password for anoncvs at
	# cvs -qR up -APd -I '!' -I CVS -rRELENG_4_10 2>&1 | \
	  tee /root/cvs-update.log

    Note the -R option to `cvs'.

    The extra -I options make sure that `cvs update' will ignore only the CVS
    subdirs of the paths it traverses.  Any stale object files or other
    unrelated to FreeBSD files found in your source tree (i.e. your kernel
    configs) should show up as lines starting with "?".  Useful to know if
    your source tree is clean.

    When the update is done you can skim through /root/cvs-update.log for the
    details you might have missed while it was running.

b.  If /usr/src is not a checkout but a CVSup-created directory:

    You'll have to backup your sources and do a real checkout.  This is going
    to take a long time, since CVS is not so fast as CVSup; it also puts a
    great amount of load to the CVS server so you should be a bit patient when
    checking our large trees, like the entire src/.

    So you should first back up your existing /usr/src tree.

	# cd /usr
	# tar cvf - src | gzip -9c -> src.tar.gz
	# rm -fr src

    Then checkout:

        # export CVSROOT='anoncvs at'
        # cvs login:
        password for anoncvs at
        # cvs -qR co -rRELENG_4_10 src 2>&1 | tee /root/cvs-checkout.log

    and look in `/root/cvs-checkout.log' for possible errors or anything that
    could be wrong.

- Giorgos

More information about the freebsd-questions mailing list