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

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



For installing 3rd party applications and programs in FreeBSD there is a 3 way

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

How to find applications and programs programs in FreeBSD

Find installed applications (using ackage 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)

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:  obrien@FreeBSD.org
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

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

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

2 Responsesto “[How To] Install, uninstall and manage programs in FreeBSD”

  1. LQman Hkeem says:

    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

  2. admin says:

    Thank You !

Trackbacks/Pingbacks

  1. Links 18/1/2012: Btrfs In Linux 3.3, Oxygen-gtk3 1.0, Woz Says Android Better Than hypePhone | Techrights - [...] Install, uninstall and manage programs in FreeBSD [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>