From 2b238a2758ca0712d5bf01bcc0be6641e7233274 Mon Sep 17 00:00:00 2001 From: rillig Date: Thu, 18 Oct 2007 22:44:09 +0000 Subject: Rewrote the section on installing binary packages so that it reads more like a HOWTO instead of an arbitrary collection of facts. It also resembles the new directory layout on ftp.NetBSD.org now, with the bootstrap.tar.gz installed near the binary packages. --- doc/guide/files/using.xml | 119 ++++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 51 deletions(-) (limited to 'doc/guide') diff --git a/doc/guide/files/using.xml b/doc/guide/files/using.xml index d69bdfd46fd..5a637326af2 100644 --- a/doc/guide/files/using.xml +++ b/doc/guide/files/using.xml @@ -1,4 +1,4 @@ - + Using pkgsrc @@ -13,20 +13,20 @@ and you can still use binary packages from someone else. Using binary packages - To use binary packages, you need some tools to manage them. On - NetBSD, these tools are already installed. On all other operating - systems, you need to install them first. For some platforms, these - tools are already packages in an archive, ready to be extracted in the - / directory. They can be found in the bootstrap-pkgsrc - directory of the FTP server. - - These pre-built package tools use - /usr/pkg for the base directory, and - /var/db/pkg for the database of installed - packages. If you cannot use these directories for whatever - reasons (maybe because you're not root), you have to build the - package tools yourself, which is explained in On the ftp.NetBSD.org + server and its mirrors, there are collections of binary packages, + ready to be installed. These binary packages have been built using the + default settings for the directories, that is: + + + /usr/pkg for LOCALBASE, where most of the files are installed, + /usr/pkg/etc for configuration files, + /var for VARBASE, where those files are installed that may change after installation. + + + If you cannot use these directories for whatever reasons (maybe + because you're not root), you cannot use these binary packages, but + have to build the packages yourself, which is explained in . @@ -41,51 +41,68 @@ and you can still use binary packages from someone else. platforms. First, select your operating system. (Ignore the directories with version numbers attached to it, they just exist for legacy reasons.) Then, select your hardware architecture, and in the - third step, the OS version and the version of pkgsrc. - This directory contains a subdirectory called - All, where (almost) all binary packages are - stored. Almost, because vulnerable packages are moved to the - vulnerable directory so they don't get - installed accidentally. - + third step, the OS version and the version of pkgsrc. + + In this directory, you often find a file called + bootstrap.tar.gz which contains the package + management tools. If the file is missing, it is likely that your + operating system already provides those tools. Download the file and + extract it in the / directory. It will create + the directories /usr/pkg (containing the tools + for managing binary packages) and /var/db/pkg + (the database of installed packages). + Installing binary packages - If you have the files on a CD-ROM or downloaded them to - your hard disk, you can install them with the following command - (be sure to su to root first): - - &rprompt; pkg_add /path/to/package.tgz - - If you have FTP access and you don't want to download the - packages via FTP prior to installation, you can do this - automatically by giving pkg_add an FTP URL: - - &rprompt; pkg_add ftp://ftp.NetBSD.org/pub/pkgsrc/packages/OPSYS/ARCH/VERSIONS/All/package + In the directory from the last section, there is a + subdirectory called All, which contains all the + binary packages that are available for the platform, excluding those + that may not be distributed via FTP or CDROM (depending on which + medium you are using), and the ones that have vulnerabilities and + therefore are considered insecure to install without thinking + before. + + To install packages directly from an FTP or HTTP server, run + the following commands in a Bourne-compatible shell (be sure to + su to root first): + + +&rprompt; PATH="/usr/pkg/sbin:$PATH" +&rprompt; PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/OPSYS/ARCH/VERSIONS/All" +&rprompt; export PATH PKG_PATH + + + Instead of URLs, you can also use local paths, for example if + you are installing from a set of CDROMs, DVDs or an NFS-mounted + repository. If you want to install packages from multiple sources, + you can separate them by a semicolon in + PKG_PATH. + + After these preparations, installing a package is very + easy: + + +&rprompt; pkg_add openoffice2 +&rprompt; pkg_add kde-3.5.7 +&rprompt; pkg_add ap2-php5-* + Note that any prerequisite packages needed to run the package in question will be installed, too, assuming they are present where you install from. - To save some typing, you can set the - PKG_PATH environment variable to a semicolon-separated - list of paths (including remote URLs); trailing slashes are not allowed. - - - Additionally to the All directory - there exists a vulnerable directory to - which binary packages with known vulnerabilities are - moved, since removing them could cause missing dependencies. To - use these packages, add the vulnerable - directory to your PKG_PATH. However, you should run - security/audit-packages regularly, - especially after installing new packages, and verify that the - vulnerabilities are acceptable for your configuration. An example - PKG_PATH would be: - ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/vulnerable - Please note that semicolon (';') is a shell meta-character, so - you'll probably have to quote it. + As mentioned above, packages for which vulnerabilities get + known are not stored in the All subdirectory. + They don't get deleted since that could be very frustrating if many + other packages depend on it. Instead, they are moved to the + vulnerable subdirectory. So you may need to add + this directory to the PKG_PATH variable. + However, you should run security/audit-packages regularly, especially + after installing new packages, and verify that the vulnerabilities + are acceptable for your configuration. After you've installed packages, be sure to have /usr/pkg/bin and /usr/pkg/sbin in your -- cgit v1.2.3