Over-whelmed by ports and package tools

Xn Nooby xnooby at gmail.com
Fri May 20 01:47:09 UTC 2011

It is hard for me to tell what tools I should be using to work with
ports and packages.  I was trying to set up a 64bit 8.2 machine as a
desktop environment, with Firefox 4 and Flash installed.  It looked
like I was going to need to track the 8.x stable branch in order to
get a Firefox package, and I was having some problems pinning down
which version of Flash I should use (they have a new version since 8l2
was released).  I decided to stop and just make sure I understood how
I was supposed to be working with ports and packages.

I've have been reading about cvsup, freebsd-update, portsnap,
portupgrade, and portmaster.  In general, I think I would like to use
packages when possible, since I expect to be doing some installs on
low-powered machines (my old laptops).  I don't want to build
everything from the ports tree (unless I have to).  I know that I can
set the environment variable PACKAGESITE in order to get packages from
8.x instead of 8.2, and the packages would at worst be a month old.  I
have also read portupgrade can be used to upgrade ports (obvious

What I have not really seen yet, is an explanation of when you might
want to use the different tools.  I have read some tools don't need
certain other things installed, but I don't know why that is
significant.  Perhaps some of the tools are only used in rare
situations, and I don't need to consider using them. I also don't know
how mutually exclusive they are.

I am working on a script to automatically load up all the software I
want on my desktop, below are some of the sub-routines that show what
I am trying to do. I think the script worked when 8.2 was new, but
things seemed to have changed and it no longer works so well. I want
to make it change-proof.

loadPorts() {
echo loadPorts...
freebsd-update fetch install
portsnap fetch extract

loadFF() {
echo loadFF...
pkg_add -r firefox
echo 'sem_load="YES"' >> /boot/loader.conf

loadApps() {
echo loadApps...
apps="bash unzip p7zip vlc xmms subversion mplayer openbox icewm
cmdwatch xfe miro filezilla"
for x in $apps
pkg_add -r $x

loadFonts() {
echo loadFonts...
cd /usr/ports/x11-fonts/webfonts
make install clean
pkg_add -r dejavu
sed '
/Section "Module"/ a\
Load "freetype"\
Load "type1"
' /etc/X11/xorg.conf > /etc/X11/xorg.conf.sed
cp /etc/X11/xorg.conf.sed /etc/X11/xorg.conf
sed '
/Section "Files"/ a\
FontPath "/usr/local/lib/X11/fonts/webfonts/"\
FontPath "/usr/local/lib/X11/fonts/dejavu/"
' /etc/X11/xorg.conf > /etc/X11/xorg.conf.sed
cp /etc/X11/xorg.conf.sed /etc/X11/xorg.conf
fc-cache -f -v

loadFlash() {
echo loadFlash...
kldload linux
pkg_add -r linux_base-f10
echo 'linux_enable="YES"' >> /etc/rc.conf
echo 'linproc /usr/compat/linux/proc linprocfs rw 0 0' >> /etc/fstab
mount -a
pkg_add -r nspluginwrapper
cd /usr/ports/www/linux-f10-flashplugin10
mkdir -p /usr/ports/distfiles/flashplugin/10.1r53
scp me at
make install clean
mkdir /usr/local/lib/browser_plugins
ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so
# read -p "pausing"

More information about the freebsd-questions mailing list