Prev | Next |
The following sections provide basic instructions on using the ports collection to install or remove programs from your system.
Before you can install ports, you must first obtain the ports collection--which is essentially a set of Makefiles, patches, and description files placed in /usr/ports.
First method to obtain the ports collection is to download the ports.tar.gz file from MicroBSD and to install it.
The alternative method to obtain and keep your ports collection up to date is by using CVS. See the CVS man pages for more info about using the program.
The first thing that should be explained when it comes to the ports collection is what is actually meant by a ``skeleton''. In a nutshell, a port skeleton is a minimal set of files that tell your MicroBSD system how to cleanly compile and install a program. Each port skeleton includes:
A Makefile. The Makefile contains various statements that specify how the application should be compiled and where it should be installed on your system.
A distinfo file. This file contains information about the files that must be downloaded to build the port and their checksums, to verify that files have not been corrupted during the download.
A files directory. This directory contains patches to make the program compile and install on your MicroBSD system. Patches are basically small files that specify changes to particular files. They are in plain text format, and basically say ``Remove line 10'' or ``Change line 26 to this ...''. Patches are also known as ``diffs'' because they are generated by the diff program.
This directory may also contain other files used to build the port.
A pkg-comment file. This is a one-line description of the program.
A pkg-descr file. This is a more detailed, often multiple-line, description of the program.
A pkg-plist file. This is a list of all the files that will be installed by the port. It also tells the ports system what files to remove upon deinstallation.
Some ports have other files, such as pkg-message. The ports system uses these files to handle special situations.
Now that you have enough background information to know what the ports collection is used for, you are ready to install your first port. The port includes instructions on how to build source code, but not the actual source code. You can get the source code from the Internet. Source code is distributed in whatever manner the software author desires. Frequently this is a tarred and gzipped file, but it might be compressed with some other tool or even uncompressed. The program source code, whatever form it comes in, is called a ``distfile''. You can get the distfile from the Internet.
As with the last section, this section makes an assumption that you have a working Internet connection. If you do not, you will need to perform to get the source from CD-ROM and put a copy of the distfile into /usr/ports/distfiles manually.
The steps involved are identical:
# make install ===> Extracting for xfig-3.2.2 ===> xfig-3.2.2 depends on shared library: jpeg.62. - /usr/local/lib/libjpeg.so.62.0 found ===> xfig-3.2.2 depends on shared library: Xaw3d.6. - not found ===> Verifying install for Xaw3d.6. in /usr/ports/x11/Xaw3d >> Xaw3d-1.3.tar.gz doesn't seem to exist on this system. >> Attempting to fetch from ftp://crl.dec.com/pub/X11/contrib/widgets/Xaw3d/R6.1/. Connected to crl.dec.com. 220 crl.dec.com FTP server (Digital UNIX Version 5.60) ready. 331 Guest login ok, send ident as password. 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. 200 Type set to I. 250 CWD command successful. 250 CWD command successful. Retrieving pub/X11/contrib/widgets/Xaw3d/R6.1/Xaw3d-1.3.tar.gz local: Xaw3d-1.3.tar.gz remote: Xaw3d-1.3.tar.gz 227 Entering Passive Mode (192,58,206,2,5,14) 150 Opening BINARY mode data connection for Xaw3d-1.3.tar.gz (0.0.0.0,0) (290277 bytes). 100% |**************************************************| 283 KB 00:00 ETA 226 Transfer complete. 290277 bytes received in 101.09 seconds (2.80 KB/s) 221 Goodbye. ===> Extracting for Xaw3d-1.3 /bin/mkdir -p /usr/ports/x11/Xaw3d/work/xc/lib/Xaw3d/X11/Xaw3d cd /usr/ports/x11/Xaw3d/work/xc/lib/Xaw3d/X11/Xaw3d; ln -sf ../../*.h . ===> Patching for Xaw3d-1.3 ===> Configuring for Xaw3d-1.3 mv -f Makefile Makefile.bak imake -DUseInstalled -I/usr/X11R6/lib/X11/config make Makefiles #
As you can see, the only difference is the line that tells you where the system is fetching the port distfile from.
The ports system uses fetch to download the files, which honours various environment variables, including FTP_PASSIVE_MODE, FTP_PROXY, and FTP_PASSWORD. You may need to set one or more of these if you are behind a firewall, or need to use an FTP/HTTP proxy. See fetch for the complete list.
Now that you know how to install ports, you are probably wondering how to remove them, just in case you install one and later on decide that you installed the wrong port. As with installing ports, the first thing you must do is change to the port directory. After you change directories, you are ready to uninstall. This is done with the make deinstall command.
That was easy enough. You have removed the program from your system. If you would like to reinstall it, you can do so by running make reinstall from the port directory.
The make deinstall and make reinstall sequence does not work once you have run make clean. If you want to deinstall a port after cleaning, use pkg_delete.
Prev | Home | Next |
Using the Packages System | Post-installation activities |
This, and other documents, can be downloaded from MicroBSD.
For questions about MicroBSD, read the documentation before contacting
<MicroBSD Support>.
Copyright © 1995-2003 by The FreeBSD Documentation Project, OpenBSD FAQ Copyright © 1998-2003 OpenBSD, Modified for MicroBSD