update for rename of docs/user/DebugKernelCrashDumps.mdwn to docs/user/list/DebugKern...
[ikiwiki.git] / docs / handbook / handbook-pkgsrc-using.mdwn
1 ## Using the Binary Packages System 
2
3
4
5 ***DragonFly customizations contributed by Chern Lee and Adrian Nida. ***
6
7
8
9 ### Installing a Binary Package 
10
11 You can use the [pkg_add(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_add&section1) utility to install a pkgsrcĀ® software package from a local file or from a server on the network.
12
13  **Example Downloading a Package Manually and Installing It Locally** 
14
15
16     # ftp -a chlamydia.fs.ei.tum.de
17     Trying 129.187.54.14:21 ...
18     Connected to chlamydia.fs.ei.tum.de.
19     220 chlamydia.fs.ei.tum.de FTP server (tnftpd 20040810) ready.
20     331 Guest login ok, type your name as password.
21     230 Guest login ok, access restrictions apply.
22     Remote system type is UNIX.
23     Using binary mode to transfer files.
24     ftp> cd pub/DragonFly/packages/DragonFly-2.2/pkgsrc-2008Q4/All/
25     250 CWD command successful.
26     ftp> get screen-4.0.3nb2.tgz
27     local: screen-4.0.3nb2.tgz remote: screen-4.0.3nb2.tgz
28     229 Entering Extended Passive Mode (|||50048|)
29     150 Opening BINARY mode data connection for 'screen-4.0.3nb2.tgz' (527880 bytes).
30     100% |************************************************|   515 KiB    3.01 MiB/s    00:00 ETA
31     226 Transfer complete.
32     527880 bytes received in 00:00 (3.01 MiB/s)
33     ftp> quit
34     221 Thank you for using the FTP service on chlamydia.fs.ei.tum.de.
35     
36     # pkg_add screen-4.0.3nb2.tgz
37
38 **Note:** It should be noted that simply issuing:
39     
40     # pkg_add ftp://chlamydia.fs.ei.tum.de/pub/DragonFly/packages/DragonFly-2.2/pkgsrc-2008Q4/All/screen-4.0.3nb2.tgz
41
42 will yield the same result as the above example.
43
44 Unlike the FreeBSD version, the pkgsrc [pkg_add(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_add&section1) does not need to be passed the `-r` option. As can be seen from the second example, you just need to pass in the URL of the package. The utility will also always automatically fetch and install all dependencies.
45
46 The example above would download the correct package and add it without any further user intervention. If you want to specify an alternative DragonFly Packages Mirror, instead of the main distribution site, you have to set `PACKAGESITE` accordingly, to override the default settings. [pkg_add(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_add&section1) uses [fetch(3)](http://leaf.dragonflybsd.org/cgi/web-man?command=fetch&section=3) to download the files, which honors 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(3)](http://leaf.dragonflybsd.org/cgi/web-man?command=fetch&section=3) for the complete list.
47
48
49
50 Binary package files are distributed in `.tgz` formats. You can find them at the default location ftp://ftp.pkgsrc-box.org/packages/, among other sites. The layout of the packages is similar to that of the `/usr/pkgsrc` tree. Each category has its own directory, and every package can be found within the `All` directory.
51
52
53
54 The directory structure of the binary package system matches the source tree layout; they work with each other to form the entire package system.
55
56 #### Using pkg_radd 
57
58 Since DragonFly 1.11 you can use [pkg_radd(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_radd&section1) to install binary packages without having to set `PACKAGESITE` or providing the complete URL.  [pkg_radd(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=pkg_radd&section=1) will handle that for you:
59
60     
61
62     # pkg_radd host
63     #
64
65
66 ### Dealing with different package versions 
67
68 Due to the fact that the official packages are only build for the RELEASE-Version of DragonFly, it is possible that you see a warning when installing binary packages on a DEVELOPMENT-version of DragonFly.  The warning could look like this:
69
70     pkg_add: Warning: package `vim-gtk2-7.1.116.tgz' was built for a different version of the OS:
71     pkg_add: DragonFly/i386 1.10.1 (pkg) vs. DragonFly/i386 1.11.0 (this host)
72
73 You can safely ignore this warning.  Normally all packages build for RELEASE run fine on DEVELOPMENT unless a major API-breakage was introduced.  In this case you would see a message from the developers on the appropriate mailing list.
74
75 ### Managing Packages 
76
77 [pkg_info(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_info&section1) is a utility that lists and describes the various packages installed.
78
79
80
81     # pkg_info
82     digest-20050731     Message digest wrapper utility
83     screen-4.0.2nb4     Multi-screen window manager
84     ...
85
86 [pkg_version(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_version&section1) is a utility that summarizes the versions of all installed packages. It compares the package version to the current version found in the ports tree.
87
88 ### Deleting a Package 
89
90 To remove a previously installed software package, use the [pkg_delete(1)](http://leaf.dragonflybsd.org/cgi/web-man?command#pkg_delete&section1) utility.
91
92
93     # pkg_delete screen-4.0.3.tgz
94
95 ### Miscellaneous 
96
97 All package information is stored within the `/var/db/pkg` directory. The installed file list and descriptions of each package can be found within subdirectories of this directory.