[wplug-bsd] [newbie] How to un-screw my ports?

Bill Moran wmoran at potentialtech.com
Sun Sep 12 02:11:27 EDT 2004


Mark Dalrymple <wplug at badgertronics.com> wrote:
> Greetings,
> 
> I've got a FreeBSD system (4.10-RELEASE #0), and I've done something 
> Bad with regards
> to my ports.  Lately, every time I've tried to build something 
> (specifically dia,
> and openoffice 1.1), I get an error in some Low Level Fundamental 
> Place, like
> I get a segv in python (when trying to get dia) or a "bootstrap 
> comparison failure!" making /usr/ports/lang/gcc32 for openoffice.
> 
> Is there a way to say "flush any ports I may have built / installed and 
> let me start over from scratch"?

The ports system is tied to the package system.  IOW: once a port is
compiled, it's turned into a package and the package is installed.  As
a result, you can use the pkg_* commands to check out what packages
you have installed.  You can also be super-l33t like me and browse
through the /var/db/pkg directory to see what's installed.  Each package
has a directory in there, and in that directory are ASCII files with
information about what files the package installed, what other packages
it depends on, etc ... pkg_delete is the easy way to get rid of
packages you don't want.

To clean out a port after it's been packaged and install, "make clean"
from the port directory is recommended.  This will remove all the
intermediate files used to build/install the port.

In the "very spiffy" category are a few utilities that are being
considered as additions to FreeBSD, but are currently in the ports.

pkg_cutleaves is one.  It will go through all installed software, and
interactively list programs that nothing else is dependent on ("leaves"
in the dependency tree) so that you can determine whether or not to
keep them.  Nice utility to clean up things after experimenting with
software, then uninstalling it.

The other is portupgrade, which is a fantastic tool for updating
installed software.  Works kind of like apt-get.  You can reinstall
everything on the system with "portupgrade -af", for example.
portupgrade is dependent on the ports tree, so it can't upgrade
stuff unless you've cvsuppped your ports.  (actually, not 100%
true, but the man page for portupgrade explains it better than I
can, I think)

Another fun one is portaudit, which will let you know if any security
vulnerabilities are found in your installed software.  I consider this
a "must have" on servers.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com


More information about the wplug-bsd mailing list