FreeBSD – Install and Remove Programs
Posted 5 Februari, 2010on:
If you’re new to FreeBSD and you’ve not installed an application yet, you’re in for a treat. FreeBSD provides a wonderful and simple mechanism for installing and removing applications.
It’s called The Ports Tree.
There are three basic ways to install applications on a FreeBSD system.
[1 – Ports Tree]
[2 – Binaries on CDROM]
[3 – Packages in .tgz files]
[1-Installing from Source using the Ports Tree]
The ports tree is a directory tree containing all the information about programs that have been ported to FreeBSD, where on the internet to download their source code, and how to install them.
If you have successfully installed your FreeBSD OS and it has access to the internet, you can install applications with a stroke of the keyboard.
If you wanted to install bash for instance, you just change to the appropriate directory under /usr/ports and type: make install. Your FreeBSD box will go out on the internet, download the source code for bash, compile it, and install it on your system. It’s really simple! Here is how to do it.
make install && make clean
The bash shell is now installed on your system. If you would like to remove bash from your system. Just type:
[2-Installing from Pre-Compiled Binaries on CDROM]
Another way to install applications is to install the pre-compiled binary files from your CDROM. To install bash in this manner, follow these steps.
Insert CDROM (1) – Installation Boot, Essential Packages
Configure – Do Post-Install Configuration of FreeBSD
[3-Installing from GZipped Packages]
To install an application in this manner, you need the app in a package file (usually in the form package_name-ver.tgz). You use the pkg_add. command:
To continue our bash shell example…
That’s all there is to it. If you would like to see what programs are installed on your system type:
I like to pipe the output into the more command like so:
pkg_info | more
No matter what method you use to install an application, you can remove it from the system with the pkg_delete command:
Back to our bash shell example…
If you would like more information on this topic, consult the PORTS Section of the FreeBSD Handbook.
You can also use the man pages: