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.

Panic!

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 “CHANGE_THIS.FreeBSD.org”: 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
Options:
-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 “cvsup.uk.FreeBSD.org”. 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 cvsup.uk.FreeBSD.org /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!

About admin

Website Administrator
This entry was posted in Sysadmin and tagged . Bookmark the permalink.

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

  1. agu says:

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

  2. phil says:

    thanks, this helped me – clear and concise docs

  3. AKU says:

    hey it really helped me! tnxs a lot :)

  4. Tom says:

    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 says:

    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 says:

    thanks ^__^

  7. greenhell says:

    Thanks a lot!

  8. jelf says:

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

  9. Erik says:

    thanks, mate. i’m new to freebsd but this got me started. really appreciate that you took the time to write this post.

  10. flatdog says:

    He hates using vi, so he doesn’t edit the file, funny.
    I think you have no idea about using vi :)

  11. Azhar says:

    Thanks for this guide. It is a huge help for a newbie like me

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>