Posts Tagged ‘Vim’

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',