geekvenue.net

Welcome to Chucktips Hardware HELP WITH DEAD OS Installing FreeBSD Miscellaneous
 faq
 search
 add article
 cool-stuff
 how-to
 main
 tips


HOWTO: Keep your ports tree current
Ports and Packages Posted by Jason on Saturday September 15, @07:32PM
from the dept.
The ports tree is a fantastic tool and is one of the many reasons why I have chosen FreeBSD over other Unix-like OS's. As nice as it is however, over time it does become out dated. Using the cvsup utility and a connection to the internet, you can be sure that your ports tree is always up to date.

The wonderful thing about cvsup is that it updates existing ports and it adds any new ports to your tree that have been added to the repository.

To update your ports, you must first install the cvsup-bin utility. You can either download and install it using the ports tree, or you can install it from the FreeBSD CDROM.

Next, you need to modify the ports-supfile, which is used to choose a repository site and shall determine what ports will be updated (all ports by default).

Finally, you need to execute the cvsup command and update your ports tree. In writing this article, I assume that you already have a connection to the internet available to your FreeBSD box.


[1-Install cvsup-bin]

The cvsup utility is the client/server program used to compare the cvs repository and your ports tree. It then downloads only the ports that are newer or have changed since your install or last update. You need to be logged in as root to install this utility.

Login: root
Password: *******


cd /usr/ports/net/cvsup-bin

make install && clean


(...or on newer installations)
cd /usr/ports/net/cvsup-without-gui
make install && make clean



[2-Create or Modify the supfile]

Once you have installed the cvsup utility, you will need to create or modify a supfile. The supfile is the configuration file used by cvsup. You can find sample supfiles in the /usr/share/examples/cvsup/ directory. Copy the ports-supfile from the example directory to your /root directory and modify it like so:

cp /usr/share/examples/cvsup/ports-supfile /root
cd /root

ee ports-supfile

     -or-
vi ports-supfile

You need to modify the line that points to the site you will be using. It can be cvsup1 through cvsup9. You will get better performance depending on which site you select. You can use the traceroute utility to determine the closest and fastest server near you. If you are unfamiliar with the traceroute utility start with cvsup1.

Change:
*default host=CHANGE_THIS.FreeBSD.org

To:
*default host=cvsup1.FreeBSD.org

If you do not modify anything else in the file, your entire ports tree will be brought up to date. However, if you would only like to update a single category such as security, you can remark (#) out the src-all line and remove the remark from the category you would like updated:

In this example:

Change:
src-all

To:
# src-all

And Change
# security

To:
security

Save the file. In this example only the security category of your ports tree will be updated. However, I recommend you update the entire ports tree so that any dependent ports from different categories will all be up to date.

[3-Update your ports]

Executing the cvsup utility is easy- issue the cvsup command and the name of your supfile.

Login: root
Password: *******


cd /root
cvsup ports-supfile


The cvsup utility will now attempt to connect to the server (cvsup1) and update your ports tree. The name of the ports being updated will be displayed on the screen. A message stating that the update is finished will be displayed when cvsup is done.

[note]

If you peruse through the example supfiles, you will find that there are several different supfiles. I use two of them, the ports-supfile and stable-supfile.

Just as the ports-supfile is used to keep your ports tree up to date, the stable-supfile is used to keep the source code of the FreeBSD operating system up to date. The source can later be used to upgrade the operating system (perhaps this will be a future post).


If you would like more information on the cvsup utility, as always I recommend the man pages:

man cvsup

<  |  >

 

Related Links
  • Articles on Ports and Packages
  • Also by Jason
  • Contact author

    Lilliput Mini USB Computer Monitor

    If you have ever wanted to learn about Cisco Routers, check out my new book "Cisco Routers for the Small Business" - it's Cisco CLI for the Regular Guy!

  • Sponsors

    The Fine Print: The following comments are owned by whoever posted them.
    ( Add a Reply )

    Over 10 comments listed. Printing out index only.
    Re: HOWTO: Keep your ports tree current
    by Jason on Friday October 12, @03:38PM
    If you have a version of FreeBSD prior to FreeBSD-4.4-RELEASE, you will need to download and install a new patched version of cvsup, cvsup-16.1e.tgz from John Polsra at FreeBSD.org.
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by You4eea on Friday May 31, @11:20AM
    I have a question about the ports tree update.

    I have read a lot of meterial on the subject and I am just a little confused about the process.

    I am using FreeBSD 4.5 Say for example I go and try to install netpbm from the port tree and I get a Checksum Mismatch error. So I go to another port that I want to install and I get the same error. My assumption is that maybe my ports tree needs to be updated.

    So if I update my ports tree does that mean that I have to do a makeworld and all that stuff. Or does it just update my ports tree so that if I go and try to install netpbm or anyother port that give me the checksum mismatch error it will update my port tree and the errore message will probably go away?

    Gosh, I hope that make since.

    Great site by the way.

    You4eea
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by You4eea on Saturday July 06, @03:26PM
    Hello Jason,

    Well, I am finally doing some testing to see if I understand the whole cvsup thing.

    First off, thank you for mentioning the cvsup-without-gui, I have read a lot of meterail and everyone else has /usr/port/net/cvsup-bin and I didn't have that. I am using 4.5.

    Anyways. I have noticed a few things that left me with a few questions.

    Before I begin, I want to communicate to you and anyone else that might be reading this what was confusing me and how I think I have figured this whole thing out.

    First off, much of the meterial I read on the topic of cvsup often mixed information in the meterial regarding what it is and can be used for.
    For example:
    Correct me if I am wrong.
    the cvsup program can be used to keep not only the ports tree up to date but it can also be used to keep your source tree up to date. These two tree are totally seperate and independent of eachother.

    The SOURCE TREE is specific to FreeBSD the kernel and the core software that make it run and operate as an operating system.

    The PORTS TREE is specific to the software/package that someone uses. Such as Apache, OpenSSH, perl, senmail, etc...

    Ok, so if I want to update my PORTS TREE I can simply follow the instructions in this article and wabam! My PORTS TREE will be up to date. So if a security problem accures with like OpenSSH, I can this deinstall my current version and then reinstall via my new PORTS TREE and wabam! New and Up to date OpenSSH is in and running.

    OK, so here is a couple of questions I have now. I will use OpenSSH as my Example.
    1) Question: If I need or want to update my OpenSSH, do I deinstall OpenSSH first with the original ports tree that it was install with or can I update my ports tree and then deinstall OpenSSH then resinstall it?

    2) Question: 2 part questions
    In this tutorial you say to change the src-all to what ever you want to update if you don't want to update everything. In my port-supfile I do not have a src-all. I have "port-all" is this the same?

    3) Quesiton:
    In my /usr/share/exmaple/cvsup/ports-subfile I also have a long list of ports. They seem to corospond with the same directory/list structor as /usr/ports. Is this the case? If so then if I want to update, for example just my /usr/ports/www tree then could I comment out the ports-all and uncomment the ports-www and just the ports-www would be updated?

    Jason, I hope that my questions help others that visit your site. I know I have learned a great deal from your site. Keep up the good job.

    P.S. Check out my latest site, ApacheFAQ.Org I hope to see you there. You contributions would be greatly appreciated.

    With best personal regards,
    I am
    Very truly yours,

    You4eea
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by Soth on Monday December 02, @02:28AM
    As for today, cvsup goes from 1 to 18, and not from 1 to 9... But each day it gets bigger lol Nice doc!
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by Steve Jonnotti on Tuesday February 11, @09:25AM
    This was the most clear document on keeping ports current, however can you add the use of the refuse file?
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by Jennifer Zhao on Tuesday September 09, @09:12PM
    Hi, Jason

    you said:

    In this example:

    Change:
    src-all

    To:
    # src-all

    Do you really want to say
    In this example:

    Change:
    ports-all

    To:
    # ports-all

    Regards,Jennifer
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by Jennifer Zhao on Thursday September 11, @07:22PM
    Hi, Jason

    Just for your information. For the latest ports structure, When you do
    #ls /usr/ports/net |grep cvs
    You get
    cvsup
    cvsup-mirror
    cvsup-without-gui
    cvsync
    FreeBSD people said in some article that they removed cvsup-bin.
    So for now, you can not install cvsup-bin from ports collection from net.

    Regards,Jennifer
    [ Add a Reply to this ]
    Re: HOWTO: Keep your ports tree current
    by thenothingboy on Monday May 03, @06:00PM
    hey thank you for the well written doc. i'm a a pretty savvy guy when it comes to m$ os's but have fallen in love with freebsd. your document makes it easier for the affair to continue, as now i am learning to love cvsup. thanks meng. pax
    [ Add a Reply to this ]

     
    The Fine Print: The following comments are owned by whoever posted them.
    ( Article Reply )

    "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate

    Powered by Zope  Powered by Apache  Squishdot Powered
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann.
    [ main | post article | search ]