≡ Menu

make command

Reconfiguring FreeBSD Ports – Remove OPTIONS config For Any Port

While building Apache port I was presented with a menu from which I selected certain build options. However, certain option giving out error as follows:
===> apache-2.2.8 mod_mem_cache requires WITH_THREADS.
*** Error code 1

All I wanted to do is disable mod_mem_cache and build Apache again. Unfortunately, it is not allowing me to clear out configuration option. How do I remove all selected options and allow me to start over again?
[click to continue…]

FreeBSD Install BASH Shell

I'd like to Bash shell under FreeBSD for bash programming. How do I install bash shell under FreeBSD UNIX operating system?
[click to continue…]

How to compile program under Linux / UNIX / FreeBSD

Q. I've downloaded tar ball software but I don't know how to compile the same? Can you provide the instructions for compiling a program?

A. Many new users find it difficult to compiling programs in Linux. Usually following steps are involved:

a] Download tar ball using wget

b] Untar tar ball using tar command

c] Compile program using make or configure command

d] Install software

Task: compiling program

Step # 1: Download program tar ball:
$ wget http://url-com/prog.tar.gz
Step # 2: Untar tar ball :
$ tar -zxvf prog.tar.gz
$ cd prog

Step # 3: Untar tar ball:
Configure program:
$ ./configure
Compile program:
$ make
Install program (must be run as the root, login using su or use sudo):
$ sudo make install
$ su -
$ make install

FreeBSD install Perl language

Q. I need Perl programming language to run scripts. How do I install perl on FreeBSD operating system?

A. Practical Extraction and Report Language or Perl can be installed using FreeBSD ports or binary package system. Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).

Install perl using FreeBSD ports

Perl5 port is located at /usr/ports/lang/perl5.8. Type the command as follows to install Perl5:
# cd /usr/ports/lang/perl5.8
# make;make install;make clean

Now perl will be installed and binary path to perl is /usr/local/bin/perl.

Install perl using FreeBSD pkg_add command

Just type the following command:
# pkg_add -v -r perl

FreeBSD install VIM text editor

Q. Quick question – How do I install VIM text editor for my FreeBSD server? Currently it has old version of vi. I like vim as it is a highly configurable text editor and efficient one.

A. VIM (Vi IMproved ) is not installed by default under FreeBSD. Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs. You can install vim binary package or use FreeBSD's ports system.

Task: Install vim binary package

Type the following command to install vim lite version:
# pkg_add -r -v vim-lite

You can also use FreeBSD ports system to install vim:
# cd /usr/ports/editors/vim-lite/
# make install clean

To start vim type command:
$ vim

You can also create a alias using alias command:
$ alias vi='vim'

Add above alias to your shell start up file such as ~/.bashrc / ~/.cshrc

Task: Setup global vimrc file

You need to copy default vimrc file from /usr/local/share/vim/vim71/vimrc_example.vim to /usr/local/share/vim:
# cp /usr/local/share/vim/vim71/vimrc_example.vim /usr/local/share/vimrc

Task: Personal ~/.vimrc file

You can customize ~/.vimrc as per your requirements. Here is my own file:
$ cat ~/.vimrc
Sample output:

set nocompatible " must be the first line
filetype on
filetype indent on
filetype plugin on
set laststatus=2
set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P