Port collection is essential for OpenBSD server.
Method # 1: Install ports from CDROM
If you have OpenBSD CDROM type the following command to copy out the contents of the ports tree to /usr/ports; you would mount the CD-ROM with ports on it on /cdrom and issue a command like follows:
# mount /cdrom
# cd /usr
# tar zxf /cdrom/ports.tar.gz
Method # 2: Install ports from FTP / HTTP mirror
Use wget or ftp client and grab ports.tar.gz, enter:
# cd /usr
# wget ftp://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz
OR
# cd /usr
# ftp ftp://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz
Sample output:
--11:44:39-- ftp://ftp.openbsd.org/pub/OpenBSD/4.1/ports.tar.gz
=> `ports.tar.gz'
Resolving ftp.openbsd.org... 129.128.5.191
Connecting to ftp.openbsd.org|129.128.5.191|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/OpenBSD/4.1 ... done.
==> PASV ... done. ==> RETR ports.tar.gz ... done.
Length: 11,184,931 (11M) (unauthoritative)
100%[=================================================================================================================>] 11,184,931 236.83K/s ETA 00:00
11:45:29 (230.09 KB/s) - `ports.tar.gz' saved [11184931]
Extract ports tar.gz:
# tar -zxvf ports.tar.gz
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop










![Linux Download Password Protected Large ISO Images [ Authentication Credentials ]](http://s13.cyberciti.org/images/shared/rp/3/29.jpg)

{ 4 comments… read them below or add one }
Thank you very much for this. I had trouble getting OpenBSD kicking with a GUI but with ports it is a snap. I used “ftp” however, instead of wget, as 4.5 did not come with wget by default. Cheers.
I wish your page had ranked higher in my search results! Just wasted hours on other obscure things. This tells me exactly what I needed to know. Thanks.
you will need to install wget first before you try this in OpenBSD 4.7
and as I just discovered, you can install wget on OpenBSD by doing this:
1. ftp http://ftp.openbsd.org/OpenBSD/x.y/ports.tar.gz for your release version x.y
2. cd /usr
3. tar xvfz /path/to/ports.tar.gz
4. cd /usr/ports/net/wget
5. make
If a non-noob can recommend a more glitzy way to do this, please follow up. Thanks.