<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m10468">
    
    <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Package Management</name>
    <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:bib="http://bibtexml.sf.net/">2.2</md:version>
  <md:created xmlns:bib="http://bibtexml.sf.net/">2002/01/22</md:created>
  <md:revised xmlns:bib="http://bibtexml.sf.net/">2004/08/10 09:57:14.346 GMT-5</md:revised>
  <md:authorlist xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="arudys">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Algis</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Rudys</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">arudys@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="arudys">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Algis</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Rudys</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">arudys@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="reedstrm">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Ross</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Reedstrom</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">reedstrm@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">Linux</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">RPM</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">dpkg</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">apt</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:bib="http://bibtexml.sf.net/">This module provides an overview of packages and
application packaging for Linux.  It covers RPM and Dpkg
format, as well as the Apt tool.  It also discusses
compiling a package from source. 
</md:abstract>
</metadata>
    
    <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pkg_intro">
	    Packages are groups of files which are used by the same
	    program or subsystem.  They are generally distributed in
	    some archive format (such as zip or tar).  A package
	    management system is a system which allows such packages
	    to be installed, removed, and configured as a unit.
	</para>
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pkg_mgmt">
	    There are several mechanisms for managing packages
	    installed in a Linux system.  By far the most common is
	    RPM.  This is a package format originally created by
	    Redhat.  Dpkg, the format used by Debian, is a distant
	    second.  Apt is a toolset for managing packages, including
	    dependency resolution; while originally designed for
	    Debian, it works with RPMs as well.  Finally, it is
	    possible to install packages by compiling them from
	    source. 
	</para>
	<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="rpm">
	    <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">RPM</name>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="rpm-intro">
		RPM is the Redhat Package Manager.  While originally
		developed by Redhat, it is now also used by Suse,
		Mandrake, and several other distributions, and is by
		far the most prevalent.  In addition to supporting
		package install and removal, it provides support for
		resolving dependencies on and conflicts with other
		packages. 
	    </para>
	</section>
	<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="dpkg">
	    <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Dpkg</name>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="dpkg-intro">
		Dpkg is the Debian package manager.  Like RPM, it has
		support for dependency and conflict resolution.  It
		also supports weaker dependencies (that is, a package
		can "suggest" or "recommend" another).  Dpkg comes
		with a frontend, dselect, which automatically
		downloads packages on request, including dependencies.
		Dselect has been, to a degree, obsoleted by <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" target="apt" strength="7">Apt</cnxn>.
	    </para>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="dpkg-debconf">
		An additional feature of Dpkg is support for debconf.
		Debconf is the Debian configuration manager.  Debconf
		provides a centralized database of configuration
		settings for a given system.  This database can be
		used to allow for a non-interactive install.  It also
		provides a unified interface for changing
		configuration settings. 
	    </para>
	</section>
	<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="apt">
	    <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Apt</name>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="apt-intro">
		Apt is a frontend for package management systems.
		Originally developed to run with Dpkg, it has been
		ported to work with RPM as well.  Apt can be used to
		query or search the package database (using the
		<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">apt-cache</code> tool) or to install or
		remove a package (using the
		<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">apt-get</code> tool).  One of the
		biggest draws of Apt is the command <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">apt-get
		install package</code>, which downloads, installs,
		and configures the package and all dependencies.
	    </para>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="apt-upgrade">
		However, Apt has another powerful feature as well,
		upgrading.  Running the command <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">apt-get
		upgrade</code> will automatically download and
		install the latest version of all out-of-date
		packages.  <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">apt-get dist-upgrade</code>
		goes one further, allowing one to upgrade entire
		releases (for instance, upgrade from Debian 2.2 to
		Debian 3.0).
	    </para>
	</section>
	<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compile">
	    <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Compiling Packages by Hand</name>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compile-intro">
		For complete control over what is installed on your
		machine, the only option is to compile applications by
		hand.  This may also be necessary if the application
		you want to install is not yet being distributed in
		your distribution.  There are some packages which are
		illegal to distribute in binary form, but legal in
		source code form.
	    </para>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compile-howto">
		Source packages tend to be released as
		<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">.tar.gz</code> files.  These are
		compressed tar archives.  They can be expanded with
		the command <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">tar xzvf file.tar.gz</code>.
		Most such packages have a README or INSTALL file at
		the top level which describes how to compile and
		install the package.
	    </para>
	    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compile-autoconf">
		It is not possible to cover every possible method for
		compiling a program; we are covering the most
		straightforward, increasing common method, called
		autoconf.  The package likely uses this method if
		there is a <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">configure</code> script at
		the top level.  To compile the package, first run this
		script.  Then run <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">make</code>.  Then as
		root, run <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">make install</code>.  In the
		absence of errors, this will result in the application
		being installed as desired in the package's default
		location (generally under
		<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">/usr/local</code>).  This and other
		compile settings can generally be adjusted by passing
		options to the configure script (the
		<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">--help</code> option will list all
		available options).
	    </para>
	</section>
    </content>
</document>
