[How To] Install, uninstall and manage programs in FreeBSD

, , 3 Comments


There are three ways to install 3rd party applications and programs in FreeBSD.

  • Ports collection – Packages from source code.
  • Binary packages – Pre-built binary packages.
  • Compiling an application from source code.

How to find applications and programs programs in FreeBSD?

1. Find installed applications (using package system)

pkg_info

Output will be similar to:

gettext-0.16.1_3    GNU gettext package
libiconv-1.11_1     A character set conversion library
mysql-client-5.1.22 Multithreaded SQL database (client)
nagios-statd-3.12   Daemon/client to check remote host information for Nagios
net-snmp-5.3.1_7    An extendable SNMP implementation
perl-5.8.8_1        Practical Extraction and Report Language
pkg_info | less
pkg_info | grep mysql

Output will be similar to

mysql-client-5.1.22 Multithreaded SQL database (client)

2. Find applications to install (using ports)

whereis app_name
app_name: /usr/ports/sysutils/app_name

or

echo /usr/ports/*/*app_name*
/usr/ports/sysutils/app_name

or

cd /usr/ports
make search name=app_name
Port:   app_name-3.64.5
Path:   /usr/ports/sysutils/app_name
Info:   Lists information about open files (similar to fstat(1))
Maint:  [email protected]
Index:  sysutils
B-deps: 
R-deps:

For detailed package information type following command:

pkg_info app_name

How to install applications and programs in FreeBSD

1. Installing with pkg_add command (binary method)

For installing package named app_name-3.64.5.tgz use:

pkg_add app_name-3.64.5.tgz

For installing package using internet i.e. use the remote fetching feature add -r, and -v for verbose mode.

pkg_add -r -v app_name

2. Installing by ports(source method)

First upgrade all ports installed under /usr/ports

If you do this first time, use:

portsnap fetch 
portsnap extract

else

portsnap update

Find port wich you want to install(see upper)

whereis app_name
app_name: /usr/ports/sysutils/app_name

Installing

Change to application directory

cd /usr/ports/sysutils/app_name

Make application

make

Install application

make install

Clean application

make clean

Or you can use all in one

make install clean

How to uninstall applications and programs programs in FreeBSD

Uninstalling with pkg_delete command

For uninstalling package app_name type:

pkg_delete app_name

Uninstalling installed ports

Change to port directory

cd /usr/ports/sysutils/app_name
make deinstall

Sources:
http://www.freebsd.org/doc/handbook/ports.html
www.cyberciti.biz/faq/howto-freebsd-install-application

 

3 Responses

  1. LQman Hkeem

    January 24, 2012 5:00 pm

    correction :
    For installing package using internet i.e. use the remote fetching feature add -r (not -f), and for add -v for verbose mode.

    reference :
    man pkg_add

    Reply

Leave a Reply