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!
Warning: Declaration of Social_Walker_Comment::start_lvl(&$output, $depth, $args) should be compatible with Walker_Comment::start_lvl(&$output, $depth = 0, $args = Array) in /Users/wade/Sites/hm2k.org/wp-content/plugins/social/lib/social/walker/comment.php on line 18
Warning: Declaration of Social_Walker_Comment::end_lvl(&$output, $depth, $args) should be compatible with Walker_Comment::end_lvl(&$output, $depth = 0, $args = Array) in /Users/wade/Sites/hm2k.org/wp-content/plugins/social/lib/social/walker/comment.php on line 42
HoooooHooo thanks ……..nice frend..this problem I am source…Now I faind..again thanks
thanks, this helped me – clear and concise docs
hey it really helped me! tnxs a lot 🙂
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!
🙂
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.
thanks ^__^
Thanks a lot!
Hey, just wanted to say thanks – this was just the info needed to get me up and running.
thanks, mate. i’m new to freebsd but this got me started. really appreciate that you took the time to write this post.
He hates using vi, so he doesn’t edit the file, funny.
I think you have no idea about using vi 🙂
Thanks for this guide. It is a huge help for a newbie like me