Differences between revisions 36 and 37
Revision 36 as of 2008-07-30 15:24:00
Size: 6476
Editor: ?seisen
Comment:
Revision 37 as of 2009-03-16 03:30:28
Size: 6480
Editor: anonymous
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
||<tablestyle="width: 100%;" style="border: 0px hidden">~-Translation(s): [:Apt en ligne de commande:Français] - [:AptCLIDutch:Nederlands]-~||<style="text-align: right;border: 0px hidden"> (!) [:/Discussion:Discussion]|| ||<tablestyle="width: 100%;" style="border: 0px hidden">~-Translation(s): [[Apt_en_ligne_de_commande|Français]] - [[AptCLIDutch|Nederlands]]-~||<style="text-align: right;border: 0px hidden"> (!) [[/Discussion|Discussion]]||
Line 13: Line 13:
[[TableOfContents([3])]] <<TableOfContents([3])>>
Line 15: Line 15:
(Note: A CLI or [:Root: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.) (Note: A CLI or [[Root|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.)
Line 17: Line 17:
http://www.vanadac.com/~dajhorn/projects/lmsw/10%20Spam/01%20apt-get%20install%20perlstuff.png [[wiki:Self:AptGetInstallPerlStuffDescription D]] {{http://www.vanadac.com/~dajhorn/projects/lmsw/10%20Spam/01%20apt-get%20install%20perlstuff.png}} [[[AptGetInstallPerlStuffDescription|D]]]
Line 27: Line 27:
Open a [:Root:root] console Open a [[Root|root]] console
Line 37: Line 37:
You should read the manual for this configuration file first - type "man sources.list" at a console window. You could also read the [:SourcesList:sources.list] page. You should read the manual for this configuration file first - type "man sources.list" at a console window. You could also read the [[SourcesList|sources.list]] page.
Line 41: Line 41:
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. 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 43: Line 43:
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. 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.
Line 89: Line 89:
You'll be prompted for [:Root#head-ce8196a32ccb751d41eb2cdd1b66fa97cbc0a80c:Root password] You'll be prompted for [[Root#head-ce8196a32ccb751d41eb2cdd1b66fa97cbc0a80c|Root password]]
Line 167: Line 167:
 * ["AptTools"] - Further Apt Tools
 * ["Synaptic"] - Graphical Apt System
 * ["Aptitude"] - Powerful ncurses-based Apt System
 * ["SecureApt"] - Cryptographic signatures
 * [[AptTools]] - Further Apt Tools
 * [[Synaptic]] - Graphical Apt System
 * [[Aptitude]] - Powerful ncurses-based Apt System
 * [[SecureApt]] - Cryptographic signatures

Translation(s): ?Français - ?Nederlands

(!) ?Discussion


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

<<TableOfContents: execution failed [Argument "maxdepth" must be an integer value, not "[3]"] (see also the log)>>

(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 Spam/01 apt-get install perlstuff.png ?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:

Open a root console

# nano /etc/apt/sources.list

or

# gedit /etc/apt/sources.list

Edit!

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

Using 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 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.

Open a root console

# apt-setup

Follow the Wizard!

Using 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:

Open a root console

aptitude install apt-spy

When using apt-spy you need to at least include -d and the Debian distribution you want to check. Example first time usage:

# apt-spy -d stable

This command will check all the Debian stable repositories to see which ones are the fastest. If you want to only check the repositories where you live at you would include -a and the location which includes North America, South America, Asia, Europe, and Australia and New Zealand.

Apt-get spy options

  • -d distribution Debian distribution (ie, stable). Required unless updating.
  • -a area Area to benchmark. (eg, Europe).
  • -c config Configuration file to use.
  • -e number Number of servers to benchmark before exiting.
  • -f file File to grab when benchmarking. (relative to Debian base).
  • -i file Specify input file. For use with the -w option.
  • -m mirror-list Mirror list to use, or mirror-list to update when updating.
  • -o output-file Where to put output.
  • -p proxy Proxy server to use. In format

Using 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 password

Installing Packages

Open a root console

# aptitude install <package>
  • where <package> is the name of the package (application) you want to install.}}}

Reinstalling

To reinstall a package type in a terminal:

aptitude reinstall <package>

To reinstall with all dependencies, type:

# aptitude reinstall <package> $(apt-cache depends --recurse --installed <package> ||grep '[ ]')

Removing a Package

# aptitude 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:

# aptitude purge <package>

Updating a Package

{{{1. Open a root console

# aptitude upgrade <package>

where <package> is the name of the package (application) you want to update.

Keeping your system up-to-date

Open a root console

# aptitude update
# aptitude upgrade

This does all the "noninterfering" package upgrades.

# aptitude 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

Open a console

$ 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

Open a console

$ dpkg --list

Further Reading


?CategoryQuickPackageManagement | CategoryPackageManagement