xref: /openbsd-src/distrib/notes/packages (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1dnl	$OpenBSD: packages,v 1.49 2016/09/02 12:17:32 tb Exp $
2As complete as your OpenBSD system is, you may want to add any of several
3excellent third party software applications.  There are several ways to do
4this.  You can:
5
61) Use the OpenBSD ``package'' collection to grab a pre-compiled
7   and tested version of the application for your hardware.
8
92) Use the OpenBSD ``ports'' collection to automatically get any
10   needed source file, apply any required patches, create the
11   application, and install it for you.
12
133) Obtain the source code and build the application based
14   upon whatever installation procedures are provided with the
15   application.
16
17If you purchased the OpenBSD CD-ROM set you already have a few popular
18``packages'', and the ``ports'' collection.
19
20Instructions for installing applications from the various sources using
21the different installation methods follow.
22
23You should also refer to the packages(7) manual page.
24
25Installing applications from the CD-ROM package collection:
26
27	The OpenBSD CD-ROM ships with the most commonly installed third-party
28	applications pre-built for various hardware architectures.  Limited
29	disk space on the CD-ROM unfortunately limits the number of such
30	packages.  Check the directory OSREV/packages/MACHINE_ARCH to see which
31	packages are available for your hardware architecture.  That directory
32	will be on the same CD-ROM containing the OS installation files for
33	your architecture.
34
35	To install one or more of these packages you must:
36	1) become the superuser (root).
37	2) mount the appropriate CD-ROM.
38	3) use the ``pkg_add'' command to install the software.
39
40	Example (in which we use su(1) to get superuser privileges, thus
41	you have to be in group "wheel", see the manual page for su(1)).
42
43    $ su
44    Password: <enter your root password>
45    # mkdir -p /cdrom
46    # mount /dev/cd0a /cdrom
47    {:-#-:} pkg_add /cdrom/OSREV/packages/MACHINE_ARCH/<package-name>
48    # <add more packages if desired>
49    # umount /cdrom
50
51	Package names are usually the application name and version
52	with .tgz appended, e.g. bzip2-1.0.6p0.tgz
53
54Installing applications from the ftp.OpenBSD.org package collection:
55
56	All available packages for your architecture have been placed on
57	ftp.OpenBSD.org in the directory pub/OpenBSD/OSREV/packages/MACHINE_ARCH/
58	You may want to peruse this to see what packages are available.  The
59	packages are also on the OpenBSD mirror sites.  See
60
61		https://www.OpenBSD.org/ftp.html
62
63	for a list of current mirror sites.
64
65	Installation of a package is very easy.
66	1) become the superuser (root)
67	2) use the ``pkg_add'' command to install the software
68
69	``pkg_add'' is smart enough to know how to download the software
70	from the OpenBSD HTTP server.  Example:
71
72    $ su
73    Password: <enter your root password>
74    # pkg_add \
75      http://ftp.OpenBSD.org/pub/OpenBSD/{:--:}OSREV/packages/MACHINE_ARCH/emacs-21.4p32.tgz
76
77Installing applications from the CD-ROM ports collection:
78
79	The CD-ROM ``ports'' collection is a set of Makefiles, patches,
80	and other files used to control the building and installation
81	of an application from source files.
82
83	Creating an application from sources can require a lot of
84	disk space, sometimes 50 megabytes or more.  The first step is
85	to determine which of your disks has enough room.  Once you've
86	made this determination, read the file PORTS located on the
87	CD-ROM which contains the ports tree.
88
89	To build an application you must:
90
91	1) become the superuser (root)
92	2) have network access, or obtain the actual source files by
93	   some other means.
94	3) cd to the ports directory containing the port you wish
95	   to build.  To build samba, for example, where you'd
96	   previously copied the ports files into the /usr/ports
97	   directory: cd /usr/ports/net/samba
98	4) make
99	5) make install
100	6) make clean
101
102Installing applications from the OpenBSD ports collection:
103
104	See https://www.openbsd.org/faq/faq15.html#Ports for current
105	instructions on obtaining and installing OpenBSD ports.
106
107	You should also refer to the ports(7) manual page.
108
109Installing other applications:
110
111	If an OpenBSD package or port does not exist for an application
112	you're pretty much on your own.  The first thing to do is ask
113	<ports@OpenBSD.org> if anyone is working on a port -- there may
114	be one in progress.  If no such port exists, you might want to
115	look at the FreeBSD ports or NetBSD pkgsrc for inspiration.
116
117	If you can't find an existing port, try to make your own and
118	feed it back to OpenBSD.  That's how our ports collection grows.
119	Some details can be found in the OpenBSD Porter's Handbook at
120	https://www.openbsd.org/faq/ports/
121	with more help coming from the mailing list, <ports@OpenBSD.org>.
122