Annotation of wikisrc/pkgsrc/how_to_use_pkgsrc.mdwn, revision 1.3

1.1       mspo        1: **Contents**
                      2: 
                      3: [[!toc levels=2]]
                      4: 
                      5: #What is pkgsrc
                      6: 
1.2       wiki        7: Pkgsrc [spoken: package source] is the main package management framework for NetBSD. With pkgsrc you can easily add, remove and manage software on your system. Pkgsrc is basically a set of files, grouped by categories which contain information to install the software you have selected. All these files together are mostly referred to as the pkgsrc tree. This tree is maintained by the pkgsrc developers, who make changes to it every day. Therefore it is necessary to update the pkgsrc tree regularly.
1.1       mspo        8: 
1.3     ! asau        9: #Documentation
1.1       mspo       10: 
1.3     ! asau       11: It is strongly advised to rely on information in [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/)
        !            12: This wiki is semi-official and is frequently outdated.
        !            13: Sometimes even misleading.
1.1       mspo       14: 
                     15: #Preparing pkgsrc
                     16: 
                     17: ##Obtaining the current pkgsrc source tree
                     18: 
1.3     ! asau       19: See [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/getting.html)
1.1       mspo       20: 
1.3     ! asau       21: ##Creating WRKOBJDIR
1.1       mspo       22: 
1.3     ! asau       23: To keep the tree clean and your work directories out of it,
        !            24: create a directory, e.g.
1.1       mspo       25: 
1.3     ! asau       26:     # mkdir /usr/work
1.1       mspo       27: 
1.3     ! asau       28: and define WRKOBJDIR in /etc/mk.conf:
1.1       mspo       29: 
                     30:     WRKOBJDIR=/usr/work
                     31: 
                     32: ##Creating DISTDIR
                     33: 
1.3     ! asau       34: We also want our distfiles to be stored, outside of the pkgsrc directory.
        !            35: Therefore we add the DISTDIR variable to /etc/mk.conf
1.1       mspo       36: 
                     37:     DISTDIR=/usr/distfiles
                     38: 
                     39: and create it with:
                     40: 
                     41:     # mkdir /usr/distfiles
                     42: 
                     43: #Installing packages
                     44: 
                     45: To install packages, we need to become root.
                     46: 
                     47:     $ su 
                     48: 
                     49: then we change to the directory (category) and then to the package we want to install.
                     50: 
                     51:     # cd /usr/pkgsrc/misc/figlet
                     52: 
                     53: to install we enter
                     54: 
                     55:     # make install
                     56: 
                     57: afterwards we clean up and enter
                     58: 
                     59:     # make clean
                     60: 
                     61: if this was a package with dependencies, we also enter
                     62: 
                     63:     # make clean-depends
                     64: 
                     65: You can put them all in one line too.
                     66: 
                     67:     # make install clean clean-depends
                     68: 
                     69: If you wish to clean the distfiles, the files that have been downloaded, you enter
                     70: 
                     71:     # make distclean
                     72: 
                     73: #List Packages
                     74: 
                     75:     $ pkg_info
                     76: 
                     77: #Removing Packages
                     78: 
                     79:     # pkg_delete packagename
                     80: 
                     81: #Updating Packages
                     82: 
                     83: You can update a single package using make update.
                     84: 
                     85:     # make update
                     86: 
                     87: #On-line help
                     88: 
                     89: Besides [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/) there is also a built-in on-line help system.
                     90: 
                     91:     # make help
                     92: 
                     93: gives you the usage information. This requires you to already know the name of the target or variable you want more info on (just like man does).
                     94: 
                     95: Most targets and variable names are documented, but not all are.
                     96: See also
                     97: 
                     98: * [[How to use pkgsrc mounted over NFS]]
                     99: * [[How to use pkgsrc on AIX]]
                    100: * [[How to use pkgsrc on A/UX]]
                    101: * [[How to use pkgsrc on IRIX]]
                    102: * [[How to use pkgsrc on Linux]]
1.3     ! asau      103: * [[How to use pkgsrc on Mac OS X]
1.1       mspo      104: * [[How to use pkgsrc on OSF1]]
                    105: * [[How to use pkgsrc on Solaris]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb