old-www/LDP/www.debian.org/doc/manuals/debian-tutorial/ch-dpkg.html

634 lines
28 KiB
HTML
Raw Permalink Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Debian Tutorial (Obsolete Documentation) - Removing and installing software</title>
<link href="index.html" rel="start">
<link href="ch-disks.html" rel="prev">
<link href="ch-troubleshooting.html" rel="next">
<link href="index.html#contents" rel="contents">
<link href="index.html#copyright" rel="copyright">
<link href="ch-about.html" rel="chapter" title="1 About this manual">
<link href="ch-introduction.html" rel="chapter" title="2 Introduction">
<link href="ch-start.html" rel="chapter" title="3 Getting started">
<link href="ch-basics.html" rel="chapter" title="4 The Basics">
<link href="ch-docs.html" rel="chapter" title="5 Reading documentation and getting help">
<link href="ch-shell.html" rel="chapter" title="6 Using the shell">
<link href="ch-files.html" rel="chapter" title="7 More on files">
<link href="ch-editor.html" rel="chapter" title="8 Creating and editing text files">
<link href="ch-custom_shell.html" rel="chapter" title="9 Customizing the shell">
<link href="ch-X.html" rel="chapter" title="10 The X Window System">
<link href="ch-text_tools.html" rel="chapter" title="11 Text tools">
<link href="ch-file_tools.html" rel="chapter" title="12 File tools">
<link href="ch-disks.html" rel="chapter" title="13 Using disks">
<link href="ch-dpkg.html" rel="chapter" title="14 Removing and installing software">
<link href="ch-troubleshooting.html" rel="chapter" title="15 Troubleshooting">
<link href="ch-advanced.html" rel="chapter" title="16 Advanced topics">
<link href="ch-next.html" rel="chapter" title="17 Where to from here?">
<link href="ch-helping.html" rel="chapter" title="18 Contributing to Debian: How can I help?">
<link href="ap-apps_appendix.html" rel="appendix" title="A A brief survey of available applications">
<link href="ap-components_appendix.html" rel="appendix" title="B Summary of GNU/Linux system components">
<link href="ap-booting_appendix.html" rel="appendix" title="C Appendix C: Booting the system">
<link href="ap-misc_appendix.html" rel="appendix" title="D Miscellaneous">
<link href="ch-about.html#s-acknowldgements" rel="section" title="1.1 Acknowledgements">
<link href="ch-introduction.html#s-introduction-debian" rel="section" title="2.1 What is Debian?">
<link href="ch-introduction.html#s-introduction-DFSG" rel="section" title="2.2 What's free software?">
<link href="ch-introduction.html#s-introduction-how" rel="section" title="2.3 How to Read This Book">
<link href="ch-introduction.html#s-introduction-ldp" rel="section" title="2.4 The Linux Documentation Project">
<link href="ch-start.html#s-start-multi" rel="section" title="3.1 A multiuser, multitasking operating system">
<link href="ch-start.html#s-start-login" rel="section" title="3.2 Logging in">
<link href="ch-start.html#s-start-keys" rel="section" title="3.3 Keys">
<link href="ch-start.html#s-start-commandline" rel="section" title="3.4 Command history and editing the command line">
<link href="ch-start.html#s-start-root" rel="section" title="3.5 Logging in as root">
<link href="ch-start.html#s-start-VC" rel="section" title="3.6 Virtual consoles">
<link href="ch-start.html#s-start-shutdown" rel="section" title="3.7 Shutting down">
<link href="ch-basics.html#s-basics-commandline" rel="section" title="4.1 The command line and <samp>man</samp> pages">
<link href="ch-basics.html#s-basics-files" rel="section" title="4.2 Files and Directories">
<link href="ch-basics.html#s-basics-processes" rel="section" title="4.3 Processes">
<link href="ch-basics.html#s-basics-shell" rel="section" title="4.4 The shell">
<link href="ch-basics.html#s-basics-jobs" rel="section" title="4.5 Managing processes with Bash">
<link href="ch-basics.html#s-basics-bash" rel="section" title="4.6 A few Bash features">
<link href="ch-basics.html#s-basics-identity" rel="section" title="4.7 Managing your identity">
<link href="ch-docs.html#s-docs-sources" rel="section" title="5.1 Kinds of documentation">
<link href="ch-docs.html#s-docs-info" rel="section" title="5.2 Using info">
<link href="ch-docs.html#s-docs-textfiles" rel="section" title="5.3 Viewing text files with more and less">
<link href="ch-docs.html#s-docs-howtos" rel="section" title="5.4 HOWTOs">
<link href="ch-docs.html#s-docs-support" rel="section" title="5.5 Getting help from a person">
<link href="ch-docs.html#s-docs-sysinfo" rel="section" title="5.6 Getting information from the system">
<link href="ch-shell.html#s-shell-variables" rel="section" title="6.1 Environment variables">
<link href="ch-shell.html#s-shell-path" rel="section" title="6.2 Where commands live: the <samp>PATH</samp> variable">
<link href="ch-shell.html#s-custom_shell-aliases" rel="section" title="6.3 Aliases and shell functions">
<link href="ch-shell.html#s-shell-io" rel="section" title="6.4 Controlling input and output">
<link href="ch-shell.html#s-shell-modifiers" rel="section" title="6.5 Specifying how and when to run commands">
<link href="ch-shell.html#s-shell-wildcards" rel="section" title="6.6 Filename expansion (&quot;Wildcards&quot;)">
<link href="ch-shell.html#s6.7" rel="section" title="6.7 Interactive/non-interactive">
<link href="ch-files.html#s-files-permissions" rel="section" title="7.1 Permissions">
<link href="ch-files.html#s-files-tour" rel="section" title="7.2 What files are on my system? Where can I put my own files?">
<link href="ch-files.html#s-file-manager" rel="section" title="7.3 Using a filemanager">
<link href="ch-editor.html#s-editor-textfile" rel="section" title="8.1 What's a text file?">
<link href="ch-editor.html#s-editor-editor" rel="section" title="8.2 Text editors">
<link href="ch-editor.html#s-editor-vi" rel="section" title="8.3 Creating and editing a text file with <code>vi</code>">
<link href="ch-custom_shell.html#s-custom_shell-dotfiles" rel="section" title="9.1 .rc files and <samp>ls -a</samp>">
<link href="ch-custom_shell.html#s-custom_shell-etc" rel="section" title="9.2 System-wide vs. user-specific configuration">
<link href="ch-X.html#s-X-starting" rel="section" title="10.1 Starting the X environment">
<link href="ch-X.html#s-X-intro" rel="section" title="10.2 Intro: What is X">
<link href="ch-X.html#s-X-basics" rel="section" title="10.3 Basic X operations">
<link href="ch-X.html#s-X-startup" rel="section" title="10.4 Customizing your X startup">
<link href="ch-text_tools.html#s-text_tools-regexps" rel="section" title="11.1 Regular expressions">
<link href="ch-file_tools.html#s-file_tools-backup" rel="section" title="12.1 Backup tools">
<link href="ch-file_tools.html#s-file_tools-compression" rel="section" title="12.2 File compression with <samp>gzip</samp>">
<link href="ch-file_tools.html#s-file_tools-split" rel="section" title="12.3 Splitting files into smaller pieces">
<link href="ch-file_tools.html#s-file_tools-find" rel="section" title="12.4 Finding files">
<link href="ch-file_tools.html#s-file_tools-file" rel="section" title="12.5 Determining a file's contents">
<link href="ch-disks.html#s-disks-concepts" rel="section" title="13.1 Concepts">
<link href="ch-disks.html#s-disks-mount" rel="section" title="13.2 <samp>mount</samp> and <samp>/etc/fstab</samp>">
<link href="ch-disks.html#s-network-ppp" rel="section" title="13.3 PPP">
<link href="ch-dpkg.html#s-dpkg-dpkg" rel="section" title="14.1 The <code>dpkg</code> package utility">
<link href="ch-dpkg.html#s-dpkg-what" rel="section" title="14.2 What a package maintenance utility does">
<link href="ch-dpkg.html#s-dpkg-apt" rel="section" title="14.3 Apt">
<link href="ch-dpkg.html#s-dpkg-dselect" rel="section" title="14.4 Using dselect.">
<link href="ch-dpkg.html#s-dpkg-commandline" rel="section" title="14.5 Using dpkg manually">
<link href="ch-dpkg.html#s-dpkg-compiling" rel="section" title="14.6 Compiling software yourself">
<link href="ch-dpkg.html#s-dpkg-proprietary" rel="section" title="14.7 Proprietary software not in .deb format">
<link href="ch-troubleshooting.html#s-troubleshooting-frozen" rel="section" title="15.1 Debian is frozen or crashed!">
<link href="ch-troubleshooting.html#s-troubleshooting-termgarbage" rel="section" title="15.2 My terminal isn't behaving properly">
<link href="ch-troubleshooting.html#s-troubleshooting-vi" rel="section" title="15.3 The computer beeps when I press a key, and my screen shows a text file and/or a lot of <samp>~</samp> symbols.">
<link href="ch-advanced.html#s-advanced-scripting" rel="section" title="16.1 Introduction to shell scripting">
<link href="ch-advanced.html#s-advanced-files" rel="section" title="16.2 Advanced files">
<link href="ch-advanced.html#s-advanced-kernel" rel="section" title="16.3 Compiling the kernel">
<link href="ch-advanced.html#s-advanced-security" rel="section" title="16.4 A few words on security">
<link href="ch-advanced.html#s-advanced-programming" rel="section" title="16.5 Programming on Linux">
<link href="ch-next.html#s-next-manuals" rel="section" title="17.1 Other Debian manuals to read">
<link href="ch-next.html#s-next-resources" rel="section" title="17.2 Other resources">
<link href="ch-helping.html#s-helping-bugs" rel="section" title="18.1 Submit bug reports">
<link href="ch-helping.html#s-helping-other" rel="section" title="18.2 Other things">
<link href="ap-apps_appendix.html#s-A_apps-whatever" rel="section" title="A.1 (Subheadings could copy the structure of the menu system)">
<link href="ap-misc_appendix.html#s-unix-history" rel="section" title="D.1 Unix History">
<link href="ap-misc_appendix.html#sD.2" rel="section" title="D.2 GNU/Linux History">
<link href="ap-misc_appendix.html#sD.3" rel="section" title="D.3 The Linux kernel's version numbering">
<link href="ch-introduction.html#s-introduction-debian-os" rel="subsection" title="2.1.1 What's an operating system, and what sort of operating system is Debian?">
<link href="ch-introduction.html#s-introduction-debian-how" rel="subsection" title="2.1.2 Who creates Debian?">
<link href="ch-basics.html#s-basics-commandline-description" rel="subsection" title="4.1.1 Describing the command line">
<link href="ch-basics.html#s-basics-files-intro" rel="subsection" title="4.2.1 Introduction to files">
<link href="ch-basics.html#s-basics-files-using" rel="subsection" title="4.2.2 Using files: a tutorial">
<link href="ch-basics.html#s-basics-bash-completion" rel="subsection" title="4.6.1 Tab Completion">
<link href="ch-docs.html#s-docs-support-posting" rel="subsection" title="5.5.1 Dos and Don'ts of asking a question">
<link href="ch-shell.html#s-shell-variables-parents" rel="subsection" title="6.1.1 Parent and child processes">
<link href="ch-shell.html#s-interactive-shells" rel="subsection" title="6.7.1 Interactive shells">
<link href="ch-files.html#s-files-permissions-groups" rel="subsection" title="7.1.1 File Ownership">
<link href="ch-files.html#s-files-permissions-mode" rel="subsection" title="7.1.2 Mode">
<link href="ch-files.html#s-files-permissions-tutorial" rel="subsection" title="7.1.3 Permissions in practice">
<link href="ch-editor.html#s-editor-vi-creating" rel="subsection" title="8.3.1 Creating a file">
<link href="ch-editor.html#s-editor-vi-editing" rel="subsection" title="8.3.2 Editing an existing file">
<link href="ch-editor.html#s-editor-vi-editing-movement" rel="subsection" title="8.3.2.1 Moving around in a file">
<link href="ch-editor.html#s-editor-vi-editing-deletion" rel="subsection" title="8.3.2.2 Deleting text">
<link href="ch-editor.html#s-editor-vi-editing-moremoving" rel="subsection" title="8.3.2.3 Sophisticated movement">
<link href="ch-editor.html#s-editor-vi-editing-numbers" rel="subsection" title="8.3.2.4 Repeating commands">
<link href="ch-editor.html#s-editor-vi-editing-advanced" rel="subsection" title="8.3.2.5 Advanced reference">
<link href="ch-X.html#s-X-basics-mouse" rel="subsection" title="10.3.1 The mouse">
<link href="ch-X.html#s-X-basics-clients" rel="subsection" title="10.3.2 X clients">
<link href="ch-X.html#s-X-basics-trouble" rel="subsection" title="10.3.3 Troubleshooting">
<link href="ch-X.html#s-X-basics-leaving" rel="subsection" title="10.3.4 Leaving the X environment">
<link href="ch-disks.html#s-disks-mount-mounting" rel="subsection" title="13.2.1 Mounting a filesystem">
<link href="ch-disks.html#s-disks-mount-cdromexample" rel="subsection" title="13.2.2 Example: Mounting a CD-ROM">
<link href="ch-disks.html#s-disks-mount-fstab" rel="subsection" title="13.2.3 <samp>/etc/fstab</samp>: Automating the mount process">
<link href="ch-disks.html#s-disks-mount-removable" rel="subsection" title="13.2.4 Removable disks (floppies, Zip disks, etc.)">
<link href="ch-disks.html#s-network-ppp-introduction" rel="subsection" title="13.3.1 Introduction">
<link href="ch-disks.html#s-network-ppp-preparation" rel="subsection" title="13.3.2 Preparation">
<link href="ch-disks.html#s-network-ppp-wvdial" rel="subsection" title="13.3.3 The Easy Way: <samp>wvdial</samp>">
<link href="ch-disks.html#s-network-ppp-pppd" rel="subsection" title="13.3.4 Doing It Manually">
<link href="ch-dpkg.html#s-apt-config" rel="subsection" title="14.3.1 Configuring Apt">
<link href="ch-dpkg.html#s-apt-usage" rel="subsection" title="14.3.2 Using apt-get.">
<link href="ch-advanced.html#s-advanced-scripting-why" rel="subsection" title="16.1.1 What and why">
<link href="ch-advanced.html#s-advanced-scripting-example" rel="subsection" title="16.1.2 A simple example">
<link href="ch-advanced.html#s-advanced-files-hardlinks" rel="subsection" title="16.2.1 The real nature of files: hard links and inodes">
<link href="ch-advanced.html#s-advanced-files-types" rel="subsection" title="16.2.2 Types of files">
<link href="ch-advanced.html#s-advanced-files-types-symlinks" rel="subsection" title="16.2.2.1 Symbolic links">
<link href="ch-advanced.html#s-files-misc-types-devices" rel="subsection" title="16.2.2.2 Device files">
<link href="ch-advanced.html#s-advanced-files-types-devices-null" rel="subsection" title="16.2.2.2.1 <samp>/dev/null</samp>">
<link href="ch-advanced.html#s-advanced-files-types-pipes" rel="subsection" title="16.2.2.3 Named pipes (FIFOs)">
<link href="ch-advanced.html#s-advanced-files-types-sockets" rel="subsection" title="16.2.2.4 Sockets">
<link href="ch-advanced.html#s-advanced-files-proc" rel="subsection" title="16.2.3 The <samp>proc</samp> filesystem">
<link href="ch-advanced.html#s-advanced-files-permissions" rel="subsection" title="16.2.4 Advanced aspects of file permissions">
<link href="ch-advanced.html#s-advanced-files-permissions-absolute" rel="subsection" title="16.2.4.1 Using numeric arguments with <samp>chmod</samp>">
<link href="ch-advanced.html#s-advanced-files-chattr" rel="subsection" title="16.2.5 chattr">
<link href="ch-advanced.html#s-advanced-files-copying" rel="subsection" title="16.2.6 Large-scale copying">
<link href="ch-advanced.html#s-advanced-files-undocumented" rel="subsection" title="16.2.7 Other concepts not yet covered, but should be">
</head>
<body>
<p><a name="ch-dpkg"></a></p>
<hr>
<p>
[ <a href="ch-disks.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-about.html">1</a> ]
[ <a href="ch-introduction.html">2</a> ]
[ <a href="ch-start.html">3</a> ]
[ <a href="ch-basics.html">4</a> ]
[ <a href="ch-docs.html">5</a> ]
[ <a href="ch-shell.html">6</a> ]
[ <a href="ch-files.html">7</a> ]
[ <a href="ch-editor.html">8</a> ]
[ <a href="ch-custom_shell.html">9</a> ]
[ <a href="ch-X.html">10</a> ]
[ <a href="ch-text_tools.html">11</a> ]
[ <a href="ch-file_tools.html">12</a> ]
[ <a href="ch-disks.html">13</a> ]
[ 14 ]
[ <a href="ch-troubleshooting.html">15</a> ]
[ <a href="ch-advanced.html">16</a> ]
[ <a href="ch-next.html">17</a> ]
[ <a href="ch-helping.html">18</a> ]
[ <a href="ap-apps_appendix.html">A</a> ]
[ <a href="ap-components_appendix.html">B</a> ]
[ <a href="ap-booting_appendix.html">C</a> ]
[ <a href="ap-misc_appendix.html">D</a> ]
[ <a href="ch-troubleshooting.html">next</a> ]
</p>
<hr>
<h1>
Debian Tutorial (Obsolete Documentation)
<br>Chapter 14 - Removing and installing software
</h1>
<hr>
<h2><a name="s-dpkg-dpkg"></a>14.1 The <code>dpkg</code> package utility</h2>
<hr>
<h2><a name="s-dpkg-what"></a>14.2 What a package maintenance utility does</h2>
<p>
An application or utility program usually involves quite a few files. It might
involve libraries, data files like game scenarios or icons, configuration
files, manual pages and documentation. When you install the program, you want
to make sure you have all the files you need in the right place.
</p>
<p>
You'd also like to be able to uninstall the program. When you uninstall, you
want to be sure all the associated files are deleted. However, if a program
you still have on the system needs those files, you want to be sure you keep
them.
</p>
<p>
Finally, you'd like to be able to upgrade a program. When you upgrade, you
want to delete obsolete files and add new ones, without breaking any part of
the system.
</p>
<p>
The Debian package system solves these problems. It allows you to install,
remove, and upgrade software <em>packages</em>, which are neat little bundles
containing the program files and information that helps the computer manage
them properly. Debian packages have filenames ending in the extension
<samp>.deb</samp>, and they're available on the ftp site or on your official
Debian CD-ROM.
</p>
<hr>
<h2><a name="s-dpkg-apt"></a>14.3 Apt</h2>
<hr>
<h3><a name="s-apt-config"></a>14.3.1 Configuring Apt</h3>
<p>
Debian now supplies a tool named Apt (for &quot;A Package Tool&quot;) to help
the administrators to add or remove software more easily. Your first task will
be to customize the <samp>/etc/apt/sources.list</samp> configuration file.
This package resource list is used to locate archives of the package
distribution system in use on the system. The source list is designed to
support any number of active sources and a variety of source media. The file
lists one source per line, with the most preferred source listed first. The
format of a <samp>sources.list</samp> entry is:
</p>
<pre>
deb uri distribution [component1] [component2] [...]
</pre>
<p>
The URI for the deb type must specify the base of the Debian distribution, from
which APT will find the information it needs. distribution can specify an
exact path, in which case the components must be omitted and distribution must
end with a slash (/). This is useful for when only a particular sub-section of
the archive denoted by the URI is of interest. If distribution does not
specify an exact path, at least one component must be present. The currently
recognized URI types are cdrom, file, http, and ftp.
</p>
<dl>
<dt><samp>file</samp></dt>
<dd>
<p>
The file scheme allows an arbitrary directory in the file system to be
considered an archive. This is useful for NFS mounts and local mirrors or
archives.
</p>
</dd>
</dl>
<dl>
<dt><samp>cdrom</samp></dt>
<dd>
<p>
The cdrom scheme allows APT to use a local CDROM drive with media swapping.
Use the apt-cdrom(8) program to create cdrom entires in the source list.
</p>
</dd>
</dl>
<dl>
<dt><samp>http</samp></dt>
<dd>
<p>
The http scheme specifies an HTTP server for the archive. If an environment
variable $http_proxy is set with the format http://server:port/, the proxy
server specified in $http_proxy will be used. Users of authenticated HTTP/1.1
proxies may use a string of the format http://user:pass@server:port/. Note
that this is an insecure method of authentication.
</p>
</dd>
</dl>
<dl>
<dt><samp>ftp</samp></dt>
<dd>
<p>
The ftp scheme specifies an FTP server for the archive. APT<50>s FTP behavior is
highly configurable; for more information see the apt.conf(5) manual page.
</p>
</dd>
</dl>
<dl>
<dt><samp>copy</samp></dt>
<dd>
<p>
The copy scheme is identical to the file scheme except that packages are copied
into the cache directory instead of used directly at their location. This is
usefull for people using a zip disk to copy files around with APT.
</p>
</dd>
</dl>
<p>
A few examples:
</p>
<pre>
deb http://www.debian.org/archive stable main contrib
</pre>
<p>
Uses HTTP to access the archive at www.debian.org, and uses the stable/main and
stable/contrib areas.
</p>
<pre>
deb ftp://ftp.debian.org/debian unstable main contrib non-free
</pre>
<p>
Uses FTP to access the archive at ftp.debian.org, under the /debian directory,
and uses the unstable/main, unstable/contrib and unsunstable/non-free areas.
</p>
<pre>
deb ftp://ftp.debian.org/debian stable main
</pre>
<p>
Uses FTP to access the archive at ftp.debian.org, under the /debian directory,
and uses the stable/main area.
</p>
<p>
If this line appears as well as the one in the previous example in
<samp>sources.list</samp>, a single FTP session will be used for both resource
lines.
</p>
<pre>
deb file:/home/vincent/debian stable main contrib non-free
</pre>
<p>
Uses the archive stored locally (or NFS mounted) at /home/vincent/debian for
stable/main, stable/contrib, and stable/non-free.
</p>
<hr>
<h3><a name="s-apt-usage"></a>14.3.2 Using apt-get.</h3>
<p>
<samp>apt-get</samp> is the command-line tool for handling packages, and may be
considered the user's &quot;back-end&quot; to apt. <samp>apt-get</samp> is
very straightforward to use.
</p>
<pre>
apt-get [options] [command] [package ...]
</pre>
<p>
Where <em>command</em> is one of:
</p>
<dl>
<dt><samp>update</samp></dt>
<dd>
<p>
update is used to resynchronize the package overview files from their sources.
The overviews of available packages are fetched from the location(s) specified
in <samp>/etc/apt/sources.list</samp>. For example, when using a Debian
archive, this command retrieves and scans the Packages.gz files, so that
information about new and updated packages is available. An update should
always be performed before an <samp>upgrade dist-upgrade</samp>.
</p>
</dd>
</dl>
<dl>
<dt><samp>upgrade</samp></dt>
<dd>
<p>
upgrade is used to install the newest versions of all packages currently
installed on the system from the sources enumerated in
<samp>/etc/apt/sources.list</samp>. Packages currently installed with new
versions available are retrieved and upgraded; under no circumstances are
currently installed packages removed, or packages not already installed
retrieved and installed. New versions of currently installed packages that
cannot be upgraded without changing the install status of another package will
be left at their current version. An <samp>apt-get update</samp> must be
performed first so that apt-get knows that new versions of packages are
available.
</p>
</dd>
</dl>
<dl>
<dt><samp>dist-upgrade</samp></dt>
<dd>
<p>
<em>dist-upgrade</em>, in addition to performing the function of
<em>upgrade</em>, also intelligently handles changing dependencies with new
versions of packages; apt-get has a &quot;smart&quot; conflict resolution
system, and it will attempt to upgrade the most important packages at the
expense of less important ones if necessary. The
<samp>/etc/apt/sources.list</samp> file contains a list of locations from which
to retrieve desired package files.
</p>
</dd>
</dl>
<dl>
<dt><samp>install</samp></dt>
<dd>
<p>
<em>install</em> is followed by one or more packages desired for installation.
Each package is a package name, not a fully qualified filename (for instance in
a Debian GNU/Linux system, <em>lsdo</em> would be the argument provided, not
<em>ldso_1.9.6-2.deb</em>). All packages required by the package(s) specified
for installation will also be retrieved and installed. The
<samp>/etc/apt/sources.list</samp> file is used to locate the desired packages.
If a hyphen is appended to the package name (with no intervening space), the
identified package will be removed if it is installed. This latter feature may
be used to override decisions made by <em>apt-get</em>'s conflict resolution
system.
</p>
</dd>
</dl>
<dl>
<dt><samp>remove</samp></dt>
<dd>
<p>
<em>remove</em> is identical to install except that packages are removed
instead of installed. If a plus sign is appended to the package name (with no
intervening space), the identified package will be installed.
</p>
</dd>
</dl>
<dl>
<dt><samp>check</samp></dt>
<dd>
<p>
<em>check</em> is a diagnostic tool; it updates the package cache and checks
for broken packages.
</p>
</dd>
</dl>
<dl>
<dt><samp>clean</samp></dt>
<dd>
<p>
<em>clean</em> clears out the local repository of retrieved package files. It
removes everything but the lock file from <samp>/var/cache/apt/archives/</samp>
and <samp>/var/cache/apt/archives/partial/</samp>.
</p>
</dd>
</dl>
<p>
The most usefull options are:
</p>
<dl>
<dt><samp>-m</samp></dt>
<dd>
<p>
Ignore the missing packages if any.
</p>
</dd>
</dl>
<dl>
<dt><samp>-d</samp></dt>
<dd>
<p>
Only downloads the necessary packages, but don't install them.
</p>
</dd>
</dl>
<dl>
<dt><samp>-f</samp></dt>
<dd>
<p>
Fix broken dependancies; Run <samp>apt-get -f install</samp> to just
automagically repair the dependancy problems on your system.
</p>
</dd>
</dl>
<hr>
<h2><a name="s-dpkg-dselect"></a>14.4 Using dselect.</h2>
<hr>
<h2><a name="s-dpkg-commandline"></a>14.5 Using dpkg manually</h2>
<p>
The simplest way to install a single package you've downloaded is the command
<samp>dpkg -i</samp> (short for <samp>dpkg --install</samp>). Say you've
downloaded the package <samp>icewm_0.8.12-1.deb</samp> and you'd like to
install it. First log on as root, then type:
</p>
<pre>
dpkg -i icewm_0.8.12-1.deb
</pre>
<p>
and icewm version 0.8.12 will be installed. If you already had an older
version, dpkg will upgrade it rather than installing both versions at once.
</p>
<p>
If you want to remove a package, you have two options. The first is most
intuitive:
</p>
<pre>
dpkg -r icewm
</pre>
<p>
This will remove the icewm package (<samp>-r</samp> is short for
<samp>--remove</samp>). Note that you give only the 'icewm' for
<samp>--remove</samp>, while <samp>--install</samp> requires the entire
<samp>.deb</samp> filename.
</p>
<p>
<samp>--remove</samp> will leave configuration files for the package on your
system. A configuration file is defined as any file you might have edited in
order to customize the program for your system or your preferences. This way,
if you later reinstall the package, you won't have to set everything up a
second time.
</p>
<p>
However, you might want to erase the configuration files too, so dpkg also
provides a <samp>--purge</samp> option. <samp>dpkg --purge icewm</samp> will
permanently delete every last file associated with the icewm package.
</p>
<hr>
<h2><a name="s-dpkg-compiling"></a>14.6 Compiling software yourself</h2>
<p>
You'll have to have -dev packages installed.
</p>
<p>
Put it in /usr/local, /opt, or your home directory.
</p>
<p>
The configure --prefix; make; make install routine.
</p>
<hr>
<h2><a name="s-dpkg-proprietary"></a>14.7 Proprietary software not in .deb format</h2>
<p>
What to do with this annoying stuff (wrapper packages, /usr/local)
</p>
<hr>
<p>
[ <a href="ch-disks.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-about.html">1</a> ]
[ <a href="ch-introduction.html">2</a> ]
[ <a href="ch-start.html">3</a> ]
[ <a href="ch-basics.html">4</a> ]
[ <a href="ch-docs.html">5</a> ]
[ <a href="ch-shell.html">6</a> ]
[ <a href="ch-files.html">7</a> ]
[ <a href="ch-editor.html">8</a> ]
[ <a href="ch-custom_shell.html">9</a> ]
[ <a href="ch-X.html">10</a> ]
[ <a href="ch-text_tools.html">11</a> ]
[ <a href="ch-file_tools.html">12</a> ]
[ <a href="ch-disks.html">13</a> ]
[ 14 ]
[ <a href="ch-troubleshooting.html">15</a> ]
[ <a href="ch-advanced.html">16</a> ]
[ <a href="ch-next.html">17</a> ]
[ <a href="ch-helping.html">18</a> ]
[ <a href="ap-apps_appendix.html">A</a> ]
[ <a href="ap-components_appendix.html">B</a> ]
[ <a href="ap-booting_appendix.html">C</a> ]
[ <a href="ap-misc_appendix.html">D</a> ]
[ <a href="ch-troubleshooting.html">next</a> ]
</p>
<hr>
<p>
Debian Tutorial (Obsolete Documentation)
</p>
<address>
29 Dezember 2009<br>
<br>
Havoc Pennington <code><a href="mailto:hp@debian.org">hp@debian.org</a></code><br>
<br>
</address>
<hr>
</body>
</html>