old-www/LDP/LG/issue86/tougher.html

324 lines
12 KiB
HTML

<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<title>Debian APT Part 2: Installing Unreleased Software LG #86</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="ramankutty.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue86/tougher.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="vinayak.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
<!--endcut ============================================================-->
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Debian APT Part 2: Installing Unreleased Software</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/tougher.html">Rob Tougher</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<html>
<head><title>Debian APT Part 2 - Installing Unreleased Software</title></head>
<body>
<h3>Contents</h3>
<dl>
<dt><a href="#1">Introduction</a>
<dt><a href="#2">Overview</a>
<dt><a href="#3">Installing Unreleased Packages</a>
<dd><a href="#3.1">Initial Setup</a>
<dd><a href="#3.2">Installing An Unreleased Package</a>
<dd><a href="#3.3">Upgrading Unreleased Packages</a>
<dd><a href="#3.4">Downgrading From Unreleased To Released</a>
<dt><a href="#4">Conclusion</a>
<dt><a href="#5">References</a>
</dl>
<a name="1" />
<h3>Introduction</h3>
<p>
APT stands for the Advanced Packaging Tool - it is a package management system for Debian GNU/Linux. In
<a href="../issue84/tougher.html">Part 1</a> of this series,
I described how to use APT to install Debian software on your machine. If you are unfamiliar with APT,
you should read that first.
</p>
<p>
Part 1 focused on installing only released versions of Debian's software packages. Besides the released versions,
Debian provides unreleased packages for people who need the latest versions of software. This article describes
how to install these unreleased packages.
</p>
<a name="2" />
<h3>Overview</h3>
<p>In the last article I introduced two concepts: the package, and the package cache. Now I am introducing
a third: the <i>distribution</i>. A distribution is a collection of packages, installation scripts, user
documentation, and configuration applications unique to Debian.
<p>
There are three Debian distributions:
</p>
<ul>
<li><code><a href="http://www.debian.org/releases/stable">stable</a></code> - the released version.
<li><code><a href="http://www.debian.org/releases/testing">testing</a></code> - the candidate for the next release.
<li><code><a href="http://www.debian.org/releases/unstable">unstable</a></code> - the development version.
</ul>
<p>
The <code>stable</code> distribution is the released version of Debian. The packages in <code>stable</code>
have been tested thoroughly. Most of the packages installed on my machine come from the <code>stable</code> distribution.
</p>
<p>
The <code>testing</code> distribution is the candidate for the next release.
Packages in this distribution have undergone some testing, but require more testing before they can
be released.
When <code>testing</code> is ready, it becomes the <code>stable</code> distribution, and the
old <code>stable</code> distribution is moved to archives.
</p>
<p>
The <code>unstable</code> distribution is the development distribution. Debian volunteers update it continuously.
The packages in <code>unstable</code> may not have been tested at all, and may not work.
After a package has undergone some testing, it gets moved to the <code>testing</code> distribution.
</p>
<p>
A software package can exist in one or more of these distributions. For example, the <code>php4</code>
package is contained in all three. In <code>stable</code> its version is 4.1.2,
in <code>testing</code> its version is 4.1.2, and in <code>unstable</code> its version is 4.2.3.
I currently have version 4.1.2 installed on my machine - if I needed version 4.2.3, I could install it
from the <code>unstable</code> distribution.
</p>
<a name="3" />
<h3>Installing Unreleased Packages</h3>
<a name="3.1" />
<h4>Initial Setup</h4>
<p>
To get your machine ready to install software packages from <code>testing</code>
or <code>unstable</code>, you have to perform the following steps:
</p>
<ul>
<li>Add an entry to <code><a href="misc/tougher/sources.list.txt">/etc/apt/sources.list</a></code>
to include the distribution
<li>Modify <code><a href="misc/tougher/apt.conf.txt">/etc/apt/apt.conf</a></code> to make
the <code>stable</code> distribution the default
<li>Call <code>apt-get update</code>
</ul>
<p>
<code>sources.list</code> keeps a list of sources for Debian software.
In the last article we had 7 CDROM sources and 2
HTTP sources. Now let's add two more HTTP sources - one for the
<code>testing</code> distribution and one for the <code>unstable</code> distribution.
My <code>sources.list</code> file now looks like the following:
</p>
<pre>
# Two new sources
deb http://http.us.debian.org/debian unstable main contrib non-free
deb http://http.us.debian.org/debian testing main contrib non-free
# Sources from last article
deb http://security.debian.org/ stable/updates main
deb http://http.us.debian.org/debian stable main contrib non-free
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-6 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-7 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-5 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-4 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-3 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-2 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-1 (20020718)]/ unstable contrib main non-US/contrib non-US/main
</pre>
<p>
Next you modify <code>apt.conf</code> so that you still
use packages from <code>stable</code> by default. My
<code>apt.conf</code> file looks like the following:
</p>
<pre>
# Make 'stable' the default distribution
APT::Default-Release "stable";
</pre>
<p>
To finish the initial setup call <code>apt-get update</code>. This will download the
latest package information, and update your local package cache.
</p>
<a name="3.2" />
<h4>Installing An Unreleased Package</h4>
<p>
Let's continue our example from last section. The <code>stable</code> distribution contains version
4.1.2 of the <code>php4</code> package. Let's say you wanted version 4.2.3 - maybe
it contained some new feature you needed. You could install this package using the following command:
</p>
<pre>
prompt$ apt-get -t unstable install php4
</pre>
<p>
This would install version 4.2.3 of the <code>php4</code> package. Note the -t switch on the command line -
this is telling APT that it is allowed to use packages from the <code>unstable</code> distribution. If
you didn't include the -t switch, APT would be unable to install version 4.2.3 of the package, because the
<code>stable</code> distribution is your default.
</p>
<a name="3.3" />
<h4>Upgrading Unreleased Packages</h4>
<p>
You can upgrade your <code>testing</code> and <code>unstable</code> packages by
using the <code>apt-show-versions</code> command:
</p>
<pre>
prompt$ apt-get install `apt-show-versions -u -b | grep testing`
</pre>
<a name="3.4" />
<h4>Downgrading From Unreleased to Released</h4>
<p>
You can downgrade packages on your machine. This means that if you have a <code>testing</code> or
<code>unstable</code> package installed, and you don't want it any more, you can downgrade the package
to the latest <code>stable</code> version.
</p>
<p>
Before being able to downgrade, you must make an entry in your
<code><a href="misc/tougher/preferences.txt">/etc/apt/preferences</a></code> file. The entry
looks like the following:
</p>
<pre>
Package: php4
Pin: release a=stable
Priority: 1001
</pre>
<p>
Once you make this entry you can run the following command to downgrade a package:
</p>
<pre>
prompt$ apt-get update
</pre>
<a name="4" />
<h3>Conclusion</h3>
<p>
APT is a powerful package management system. It allows you to install, maintain, and remove
software applications from your Debian system. In this article I focused on installing software from
Debian's unreleased distributions, <code>testing</code> and <code>unstable</code>.
</p>
<a name="5" />
<h3>References</h3>
<ul>
<li><a href="http://www.debian.org/doc/">Debian documentation</a>
<li>man pages for apt-get, apt-cache, sources.list, apt.conf, and apt_preferences
</ul>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO PEN]" SRC="../gx/2002/note.png">
<em>
Rob is a software developer in the New York City area.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Rob Tougher.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<!--startcut ==========================================================-->
<CENTER>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="ramankutty.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue86/tougher.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="vinayak.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
</CENTER>
</BODY></HTML>
<!--endcut ============================================================-->