FreeBSD Obtain and Install Ports File in /usr/ports

by Vivek Gite [Last updated: November 25, 2008]

Q. I've installed FreeBSD server without ports. When installing my FreeBSD system, sysinstall asked my, if I would like to install the Ports Collection? I chose not to install it. Now, how do I obtain and install the FreeBSD ports collection in /usr/ports?

A. The FreeBSD Ports collection is a package management system which provides an easy and consistent way of installing software packages on the FreeBSD operating system.

Before you can install ports, you must first obtain the Ports Collection and placed in /usr/ports directory.

Obtaining the Ports Collection

Login as root and install portsnap package, if you are using FreeBSD 6.0 or older version:
# pkg_add -r portsnap

Obtain ports

Type the following command:
# mkdir /usr/ports
# portsnap fetch
# portsnap extract

Now, the ports collection installed in /usr/ports. You can install and update system using portupgrade and portsnap itself

You can also use sysinstall tool to install the ports collection :
# sysinstall
Select Configure > Distributions > Ports > Ok

Fig.01: Install Freebsd Ports Collection Using sysinstall

Fig.01: Install Freebsd Ports Collection Using sysinstall

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 1 comment… read it below or add one }

1 diay 11.30.08 at 10:32 am

Thanks for sharing this.

Leave a Comment

You can 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>

Tagged as: , , , , , , ,

Previous post: Fedora 10 Upgrade

Next post: Red Hat / CentOS Linux: Apache Enable WebDAV