Sunday, August 19, 2012

Keep FreeBSD up to date with csup

csup is a simple tool to keep you FreeBSD source and/or ports collection up to date (rewrite of CSVup in C). There are a number of mirrors around the world hosting the source code and you need to select one that is closest to your location. Use a tool like traceroute to find a one that responds best (shortest path, low delays).


It is recommended to copy ports configuration file (known as supfile) to your home directory.
cp /usr/share/examples/cvsup/ports-supfile .
You should change the host location, e.g.:
You can leave all other settings to it default values, however you might need to fine tune the ports of your interest (the ports are split into individual collections), e.g.:
The whole ports tree takes around 780Mb of disk space.


The system source tree is only necessary if you plan to build world/kernel. While it is time consuming (50+ minutes to build world and 15 for kernel), you might consider stay with binary updates.
cp /usr/share/examples/cvsup/stable-supfile .
Note, you should change the host location. The important configuration in source supfile is tag related to release information:
*default release=cvs tag=RELENG_9
The difference between RELENG_9 and RELENG_9_0 is that in case you set RELENG_9_0 you will get only security / critical updates for FreeBSD 9.0 and your system will not proceed with upgrades transparently to 9.1, 9.2, etc. It is recommended to stick with major release, e.g. RELENG_9.


Run csup with argument of supfile and you will get your source/ports tree synchronized.
csup ports-supfile
The first time csup is run it copies ports collection from remote mirror and it might take quite long time depending on your internet connection speed, however the next time it goes much faster.


I found portmaster is a minimalist tool to manage ports (it has no dependencies to others). Let install it:
make install clean -sC /usr/ports/ports-mgmt/portmaster
Once installed issue rehash command to update the search path for command line completion.


List all installed ports by category, and search for updates:
portmaster -L
Check all ports, update as necessary:
portmaster -a


Next time you need update your system just issue the following commands:
csup ports-supfile
portmaster -L
portmaster -a

No comments :

Post a Comment