Differences between revisions 1 and 29 (spanning 28 versions)
Revision 1 as of 2005-09-03 20:53:55
Size: 3553
Editor: ?DavidRichardBell
Comment:
Revision 29 as of 2007-12-31 15:33:41
Size: 5930
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#language en
||||<tablestyle="width: 100%; border: 0px hidden">||
||<style="border: 0px hidden">["FrontPage"] > [:Portal_Apt:Install and update] > APT in command line||<style="text-align: right; border: 0px hidden"> ||<style="text-align: right; border: 0px hidden"> (!) [:/Discussion:Discussion]||
||<style="border: 0px hidden">~-''Traduction(s): [:AptCLIDutch:Dutch] [:Apt en ligne de commande:Français]''-~||
----
Line 4: Line 9:

(Note: A CLI or root console (in GNOME) can most likely be found at "Applications -> System Tools-> Root Terminal", and "Applications -> System Tools-> Terminal" for a normal user console.)

http://www.vanadac.com/~dajhorn/projects/lmsw/10%20Spam/01%20apt-get%20install%20perlstuff.png [[wiki:Self:AptGetInstallPerlStuffDescription D]]
Line 9: Line 18:
__Editing Sources Directly__ === Editing Sources Directly ===
Line 13: Line 22:
{{{1. Open a root console/terminal window (Applications -> System Tools-> Root Terminal in GNOME) {{{1. Open a root console
Line 16: Line 25:
2b. Type "gedit /etc/apt.sources.list" 2b. Type "gedit /etc/apt/sources.list"
Line 20: Line 29:
You should read the manual for this configuration file first - type "man apt-get" at a console window. You should read the manual for this configuration file first - type "man sources.list" at a console window.
Line 22: Line 31:
__Use apt-setup__ === Use apt-setup ===
Line 24: Line 33:
You can use the '''apt-setup'' tool which generates automatic source lines and adds them to the /etc/apt/sources.list (the file which configures your apt sources). Note: apt-setup doesn't wipe your existing configuration - it simply appends more sources. apt-setup is a ["debconf"] wizard. You can use the '''apt-setup''' tool which generates automatic source lines and adds them to the /etc/apt/sources.list (the file which configures your apt sources). Note: apt-setup doesn't wipe your existing configuration - it simply appends more sources. apt-setup is a [:DebConf:debconf] wizard.
Line 26: Line 35:
{{{1. Open a root console/terminal window (Applications -> System Tools-> Root Terminal in GNOME) Note: apt-setup was part of base-config which is no longer available in DebianEtch or DebianUnstable, please refer to [DebianInstaller/RemoveBaseConfig] and to http://lists.debian.org/debian-boot/2005/12/msg00259.html for details.

{{{1. Open a root console
Line 28: Line 39:
3. Follow the Wizard!  3. Follow the Wizard!
Line 31: Line 42:
__Use apt-spy__ === Use apt-spy ===
Line 38: Line 49:
1. Open a root console window (Applications -> System Tools-> Root Terminal in GNOME) 1. Open a root console
Line 43: Line 54:
** more explanation is needed. There are 17 options for apt-spy. No example of usage is given here or in the man pages. What is the minimum number of options required? Running it as a beginner usually only results in the list of options being presented with no indication of what else is needed.

{{{
# Example first time usage:
apt-spy -a North-America -d stable
}}}


=== Use a graphical program ===

If you are using Gnome ''(I don't know for KDE)'' which is the default in Debian, you can configure your Apt sources with a graphical program. You will found it in:
 * for Etch: Desktop ''menu'' -> Administration -> Software Properties

You'll be prompted for [:Root#head-ce8196a32ccb751d41eb2cdd1b66fa97cbc0a80c:Root password]
Line 45: Line 71:
{{{1. Open a root console window (Applications -> System Tools-> Root Terminal in GNOME) {{{1. Open a root console
Line 47: Line 73:

== Reinstalling ==
To reinstall a package type in a terminal:
{{{apt-get install <package_name> --reinstall
}}}
To reinstall with all dependecies, type:
{{{apt-get install --reinstall $(apt-cache depends --recurse --installed x-window-system ||grep '[ ]')
}}}
Line 50: Line 84:
{{{1. Open a root console window (Applications -> System Tools-> Root Terminal in GNOME) {{{1. Open a root console
Line 52: Line 86:

To also delete files and directories created by the package after installation, such as configuration or status ('''Warning''': this may include files modified by the user), use:

{{{
apt-get remove --purge <package>
}}}
Line 55: Line 95:
{{{1. Open a root console window (Applications -> System Tools-> Root Terminal in GNOME)
2. Type "apt-get update <package>" where package is the name of the package (application) you want to update.}}}
{{{1. Open a root console
2. Type "apt-get install <package>" where package is the name of the package (application) you want to update.}}}
Line 60: Line 100:
{{{1. Open a root console window (Applications -> System Tools-> Root Terminal in GNOME) {{{1. Open a root console
Line 62: Line 102:
3. Type "apt-get dist-upgrade"}}} 3. Type "apt-get upgrade" (does all the "noninterfering" package upgrades).
4. Type "apt-get dist-upgrade" (This does package upgrades that require installing or removing some other package. Check the packages to be REMOVED: Any package lib<foo> is fine. If it's removing something you use, and there is nothing obviously replacing it (e.g. emacs20 replaced by emacs21), you may want to make yourself a note so you can reinstall it later (when a compatible package is available), or "pin" that package (see "man apt_preferences") before doing the "dist-upgrade".}}}
Line 64: Line 105:
==Search for packages== == Search for packages ==
Line 66: Line 107:
{{{1. Open a console window (Applications -> System Tools-> Terminal in GNOME)
2. Type "apt-cache search <string>" where <string> is the pattern to search for.}}}
{{{1. Open a console
2. Type "apt-cache search <string>" where <string> is a list of keywords to search for.}}}
Line 73: Line 114:
}}}  }}}
Line 75: Line 116:
==List installed packages== == List installed packages ==
Line 77: Line 118:
{{{1. Open a console window (Applications -> System Tools-> Terminal in GNOME) {{{1. Open a console
Line 81: Line 122:
==Further Reading== == Further Reading ==
Line 83: Line 124:
See: ["AptTools"]
See: ["Synaptic"]
 * ["AptTools"] - Further Apt Tools
 * ["Synaptic"] - Graphical Apt System
 * ["Aptitude"] - Powerful ncurses-based Apt System
 * ["SecureApt"] - Cryptographic signatures

["FrontPage"] > [:Portal_Apt:Install and update] > APT in command line

(!) [:/Discussion:Discussion]

Traduction(s): [:AptCLIDutch:Dutch] [:Apt en ligne de commande:Français]


This page describes how to use various CLI (command line interface) Apt tools.

?TableOfContents([3])

(Note: A CLI or root console (in GNOME) can most likely be found at "Applications -> System Tools-> Root Terminal", and "Applications -> System Tools-> Terminal" for a normal user console.)

http://www.vanadac.com/~dajhorn/projects/lmsw/10%20Spam/01%20apt-get%20install%20perlstuff.png ?wiki:Self:AptGetInstallPerlStuffDescription D

Configuring Apt Sources

Apt downloads packages and installs them onto your computer. To do that it connects to software repositories, or sources, which contain all the packages you'd want. You can configure Apt to use a source (or multiple sources) to get these packages from. There are many sources - web (HTTP) servers, FTP servers, CD-ROM disks, network servers (etc). Generally users download packages from the internet, since most users don't download all 14 CD's (for the current Sarge release).

Editing Sources Directly

You can edit the file which determines your sources directly:

{{{1. Open a root console 2a. Type "nano /etc/apt/sources.list"

  • - or -

2b. Type "gedit /etc/apt/sources.list" 3. Edit! }}}

You should read the manual for this configuration file first - type "man sources.list" at a console window.

Use apt-setup

You can use the apt-setup tool which generates automatic source lines and adds them to the /etc/apt/sources.list (the file which configures your apt sources). Note: apt-setup doesn't wipe your existing configuration - it simply appends more sources. apt-setup is a [:DebConf:debconf] wizard.

Note: apt-setup was part of base-config which is no longer available in DebianEtch or DebianUnstable, please refer to [DebianInstaller/RemoveBaseConfig] and to http://lists.debian.org/debian-boot/2005/12/msg00259.html for details.

{{{1. Open a root console 2. Type "apt-setup" (as root) 3. Follow the Wizard! }}}

Use apt-spy

apt-spy will generate a sources.list file (the configuration file for apt package sources) for you! It measures the latency and bandwidth to servers, and picks the best one.

To get started, you'll need to install it, and then read how to use it:

1. Open a root console
2. Type "apt-get install apt-spy"
3. Read about how to use apt-spy: type "man apt-spy"

** more explanation is needed. There are 17 options for apt-spy. No example of usage is given here or in the man pages. What is the minimum number of options required? Running it as a beginner usually only results in the list of options being presented with no indication of what else is needed.

# Example first time usage:
apt-spy -a North-America -d stable

Use a graphical program

If you are using Gnome (I don't know for KDE) which is the default in Debian, you can configure your Apt sources with a graphical program. You will found it in:

  • for Etch: Desktop menu -> Administration -> Software Properties

You'll be prompted for [:Root#head-ce8196a32ccb751d41eb2cdd1b66fa97cbc0a80c:Root password]

Installing Packages

{{{1. Open a root console 2. Type "apt-get install <package>" where package is the name of the package (application) you want to install.}}}

Reinstalling

To reinstall a package type in a terminal: {{{apt-get install <package_name> --reinstall }}} To reinstall with all dependecies, type: {{{apt-get install --reinstall $(apt-cache depends --recurse --installed x-window-system ||grep '[ ]') }}}

Removing a Package

{{{1. Open a root console 2. Type "apt-get remove <package>" where package is the name of the package (application) you want to remove.}}}

To also delete files and directories created by the package after installation, such as configuration or status (Warning: this may include files modified by the user), use:

apt-get remove --purge <package>

Updating a Package

{{{1. Open a root console 2. Type "apt-get install <package>" where package is the name of the package (application) you want to update.}}}

Keeping your system up-to-date

{{{1. Open a root console 2. Type "apt-get update". 3. Type "apt-get upgrade" (does all the "noninterfering" package upgrades). 4. Type "apt-get dist-upgrade" (This does package upgrades that require installing or removing some other package. Check the packages to be REMOVED: Any package lib<foo> is fine. If it's removing something you use, and there is nothing obviously replacing it (e.g. emacs20 replaced by emacs21), you may want to make yourself a note so you can reinstall it later (when a compatible package is available), or "pin" that package (see "man apt_preferences") before doing the "dist-upgrade".}}}

Search for packages

{{{1. Open a console 2. Type "apt-cache search <string>" where <string> is a list of keywords to search for.}}}

You may want to pipe the output (redirect the output) into "less" (a scrollable viewer) since the list may be huge:

apt-cache search <string> | less

List installed packages

{{{1. Open a console 2. Type "dpkg --list" 3. You may want to pipe (redirect) that to a program called "less" since the list will be long (type "dpkg --list | less")}}}

Further Reading

  • ["AptTools"] - Further Apt Tools

  • ["Synaptic"] - Graphical Apt System
  • ["Aptitude"] - Powerful ncurses-based Apt System
  • ["SecureApt"] - Cryptographic signatures