Posts Tagged ‘Ports’

Performing a Fresh Install/Uninstall of a FreeBSD Port

Thursday, September 8th, 2011

If you accidentally corrupt the installation or configuration of a FreeBSD port, or if you just want to wipe any old installation settings away and install a fresh copy, issuing the following command in the port directory of interest:

# make && make deinstall reinstall clean

This will first uninstall (or “deinstall”, as it’s oddly called in the FreeBSD world) the broken port, then reinstall it, and then clean up any temporary files left behind by the compiler. It will not clear any flags you set during the installation procedure (assuming the port you’re trying to install had options/flags that could be set).

If you want to reset any previously specified options/flags to whatever’s used as the port’s default, issue the following command sequence:

# make rmconfig
# make && make deinstall reinstall clean

If you want to see what options are currently set or configured, issue the following command:

# make showconfig

Note: You must execute this command as root and from the specific port directory of interest (e.g., /usr/ports/net/samba35, /usr/ports/sysutils/lsof, /usr/ports/editors/vim, etc.)

Installing vim on FreeBSD without the X Window System

Thursday, May 12th, 2011

I have absolutely no idea why a command line text editor would ever need a component from a GUI system, but as I recently discovered, trying to install Vim on FreeBSD from the ports collection will also install a whole host of X Windows System related packages that you may not be interested in.

Since the particular machine I’m working on will be a headless media server stashed in an attic somewhere, and maintained only with a terminal and SSH, I wasn’t interested in having any GUI packages installed.

To install Vim without the X Windows System, I took a look inside Vim’s Makefile and found an argument that seemed to do the trick:

# cd /usr/ports/editors/vim
# make WITHOUT_X11=yes
# make WITHOUT_X11=yes install

The rest of the installation went off without a hitch, and I now have a full install of Vim running without all the extra X11 packages taking up space on my server’s drive.

Note: If you ever use portupgrade, keep in mind that unless you specifically instruct it to do otherwise, portupgrade will assume you want to update your system with each port’s original/default install options. This means that if a new version of Vim was released, and you wanted to autoupdate your system with a single portupgrade command, you’d end up downloading, compiling, and installing all the X Windows System packages right along side the new version of Vim.

Fortunately, FreeBSD includes a way to tell portupgrade to preserve your original compile arguments, which can be found at /usr/local/etc/pkgtools.conf.

Add the following excerpt to your pkgtools.conf file, and you’ll be good to go for all future updates:

'editors/vim' => 'WITHOUT_X11=YES',