FreeBSD 6.2 “/usr/ports: No such file or directory”

I recently setup a new FreeBSD 6.2 server, only to find the following:

server# cd /usr/ports
/usr/ports: No such file or directory.

I panicked a little bit, as I’ve not setup a freeBSD server in a while, so I tried to recall what I did last time.

I remembered that all I did last time was use “cvsup”, however…

server# cvsup
cvsup: Command not found.


Here’s the deal… apparently the “cvsup” command is no longer used, and instead we’ve now got “csup“, which apparently is a rewrite of cvsup in C. This can be quite confusion if you were not aware of the change (like myself).

Now we know this we can log in as the “root” user, and setup the ports:

First of all, copy the example “ports-supfile” (needed for csup) to your root directory.

server# cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile

Now we run the csup command:

server# csup /root/ports-supfile
Name lookup failure for “”: hostname nor servname provided, or not known

Obviously there’s a problem. We need to edit the “ports-supfile” and change the host, or do we…?

server# csup
Usage: csup [options] supfile
-1 Don’t retry automatically on failure (same as “-r 0″)
-4 Force usage of IPv4 addresses
-6 Force usage of IPv6 addresses
-A addr Bind local socket to a specific address
-b base Override supfile’s “base” directory
-c collDir Subdirectory of “base” for collections (default “sup”)
-d delLimit Allow at most “delLimit” file deletions (default unlimited)
-h host Override supfile’s “host” name
-i pattern Include only files/directories matching pattern.
May be repeated for an OR operation. Default is
to include each entire collection.
-k Keep bad temporary files when fixups are required
-l lockfile Lock file during update; fail if already locked
-L n Verbosity level (0..2, default 1)
-p port Alternate server port (default 5999)
-r n Maximum retries on transient errors (default unlimited)
-s Don’t stat client files; trust the checkouts file
-v Print version and exit
-z Enable compression for all collections
-Z Disable compression for all collections

We can use the -h option of csup to supply a host override, we now just need to find a cvsup host to use. Select one that is closest to your server, for example, my server is in the UK, so I would use “”. You could also use fastest_cvsup, to find the fastest one for you.

Now we issue the command again, but now with the -h option:

server# csup -h /root/ports-supfile

And with any luck, providing your server has an internet connection the process should begin.

Note: I hate using the “vi” editor and since this system hasn’t got ports yet, I can’t install my preferred editor “nano”, once I have nano installed via ports, I would edit the ports-supfile with the selected cvsup hostname, meaning I do not have to supply one in the future when I come to update the ports.

Hope this helps somebody!

Related posts:

  1. Configuring a FreeBSD IRC Shell Server This is a brief guide created to help configure a...
  2. Setting up a FreeBSD socks proxy server for use with mIRC I’m getting fed up with my current IRC BNC software....
  3. Xen on CentOS Host running FreeBSD Guest Recently i’ve been investigating Xen. In short, Xen is open...
  4. Missing Mediaid.bin file Recently I got asked to backup a Vista machine. I’m...
  5. Storing mySQL database settings for php and perl in one file I have a situation where there’s two scripts. The main...


  1. agu said,

    February 2, 2008 @ 5:55 am

    HoooooHooo thanks ……..nice frend..this problem I am source…Now I faind..again thanks

  2. phil said,

    March 29, 2008 @ 9:34 am

    thanks, this helped me – clear and concise docs

  3. AKU said,

    August 13, 2008 @ 2:43 am

    hey it really helped me! tnxs a lot :)

  4. Tom said,

    September 6, 2008 @ 6:04 pm

    Helped me a lot!
    Thank you!
    AND I HATE vi too. It should be deleted from every hard drive in existence.
    I hate that damn ding, ding, ding, ding….^H~E crap!
    Whoever though up such a dumb editor should be shot, then burned, then shot again just to be sure!

  5. Tom said,

    September 6, 2008 @ 6:07 pm

    One more comment on FreeBSD, why can’t the damn sysinstall sort the package list before asking for a CD?
    CD swapping, package by package?
    A full package list would take days, even weeks, and wear out a CD drive door.
    Another stupid idea but not as stupid as vi.

  6. junos said,

    November 5, 2008 @ 4:34 pm

    thanks ^__^

  7. greenhell said,

    December 30, 2008 @ 11:14 pm

    Thanks a lot!

  8. jelf said,

    October 22, 2009 @ 9:17 pm

    Hey, just wanted to say thanks – this was just the info needed to get me up and running.

RSS feed for comments on this post · TrackBack URL

Leave a Comment