The FreeBSD Ports Collection - Staying Current

The ports collection makes life easier, you can go about doing make, make install without knowing much about anything else. The ports collection is growing bigger, new ports being added on a daily basis.

Using CVSup, one of the utilities in the ports collection you can stay current with the ports collection and even update your source directory tree /src.

Installing CVSup

Do these as root only,
          #cd /usr/ports/net/cvsup
          #make install clean          

After you login back, as root copy /usr/share/examples/ports-supfile to /root directory (for obvious reasons)

          #cp /usr/share/example/ports-supfile /root/ports-supfile

Now we need to do some editing, fire up your favourite editor, mine being emacs,


         #emacs /root/ports-supfile
It should look something like this,
#######################################################
*default host=cvsup.cn.FreeBSD.org.
*default base=/usr
*default prefix=/usr
*default release=cvs  tag=.
*default delete use-rel-suffix

#comment the below line if you don't want to update the /src directory
src-all 

#update /usr/ports
ports-all tag=.

#######################################################

In the first line that I edited, I chose a host nearer to India --> China (cn). Alternatively you can choose your host from here

Moment of truth has arrived, as root run
#cvsup -L 2 /root/ports-supfile
This command upgrades all the skeletons of the ports collection.
To understand what the switches stand for and more information on cvsup refer tto the manual pages,
#man cvsup 

Updating the ports database

After completing each CVSup run,
      #portsdb -Uu
An INDEX.db database is created or updated, in /usr/ports. After you get the prompt back, #portversion -l "<"

Portupgrade

If there is any output we need to upgrade those ports. All the ports can be collectively upgraded using the recursive switches,
       #portupgrade -arR
It\'s important we upgrade the dependencies of the ports also so that we do not end up with a port which refuses to upgrade. When I did this i got a message asking me to do portdb -F . This utility updates the package database located at /var/db/pkg/pkgdb.db

       #pkgdb -F
Running the above command interactively fixes the database.Do not interrupt this at any cost or you could end up with an inconsistent database. In case of a mess use,
       #pkgdb -fu
Above command, fixes everything non interactively with what it thinks to be the best option.

Summary

       1.  Use CVSup to sync the ports collection.
       2.  Portsdb to  update the database INDEX.db.
       3.  Portversion to find which all ports need upgrading.
       4.  Finally portupgrade to upgrade those ports.
       5.  Pkgdb (do it when explicitly asked for) to update the package database.

Now let me leave, I got some updated ports to install ;-). Happy holidays.

Submitted by Bepolegot (not verified) on Thu, 2007-12-13 01:45.
I am glad to find this forum ! airline tickets http://airline379tickets.com Excellent forum, added to favorites! phentermine http://phentermine-1-pills.com Very good web forum, great work and thank you for your service. payday loans http://payday333loans.com I am glad to find this forum! phentermine http://phentermine-gl-pills.com Good luck!