File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_use_pkgsrc.mdwn
Revision 1.6: download - view: text, annotated - select for diffs
Thu Apr 27 11:25:42 2017 UTC (3 years, 10 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by schmonz: update for rename of pkgsrc/How_to_use_pkgsrc_on_Solarish___40__Illumos_based__41__.mdwn to pkgsrc/solarish.mdwn

    1: **Contents**
    2: 
    3: [[!toc levels=2]]
    4: 
    5: #What is pkgsrc
    6: 
    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.
    8: 
    9: #Documentation
   10: 
   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.
   14: 
   15: #Preparing pkgsrc
   16: 
   17: ##Obtaining the current pkgsrc source tree
   18: 
   19: See [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/getting.html)
   20: 
   21: ##Creating WRKOBJDIR
   22: 
   23: To keep the tree clean and your work directories out of it,
   24: create a directory, e.g.
   25: 
   26:     # mkdir /usr/work
   27: 
   28: and define WRKOBJDIR in /etc/mk.conf:
   29: 
   30:     WRKOBJDIR=/usr/work
   31: 
   32: ##Creating DISTDIR
   33: 
   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
   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 IRIX]]
  101: * [[How to use pkgsrc on Linux]]
  102: * [[How to use pkgsrc on Mac OS X]
  103: * [[How to use pkgsrc on OSF1]]
  104: * [[How to use pkgsrc on Solaris]]
  105: * [[pkgsrc/Solarish]]

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