Differences between revisions 34 and 35
Revision 34 as of 2008-02-11 19:18:32
Size: 6070
Comment: apt-get changed to aptitude, links fixed, ToDo tag added
Revision 35 as of 2008-02-11 19:44:12
Size: 5954
Comment: changed commands presentation
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
(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.) (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 27: Line 27:
{{{1. Open a root console
2a. Type "nano /etc/apt/sources.list"
     - or -
2b. Type "gedit /etc/apt/sources.list"
3. Edit!
Open a [:Root:root] console
{{{
#
nano /etc/apt/sources.list
Line 33: Line 31:
or
{{{
# gedit /etc/apt/sources.list
}}}
Edit!
Line 34: Line 37:
You should read the manual for this configuration file first - type "man sources.list" at a console window. 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 42: Line 45:
{{{1. Open a root console
2. Type "apt-setup" (as root)
3. Follow the Wizard!
Open a root console
{{{
#
apt-setup
Line 46: Line 49:
Follow the Wizard!
Line 53: Line 57:
Open a root console
Line 54: Line 59:
1. Open a root console
2. Type "aptitude install apt-spy"
3. Read about how to use apt-spy: type "man apt-spy"
aptitude install apt-spy
Line 58: Line 61:

Read about how to use apt-spy: type "man apt-spy"
Line 61: Line 66:
Example first time usage:
Line 62: Line 68:
# Example first time usage:
apt-spy -a North-America -d stable
# apt-spy -a North-America -d stable
Line 76: Line 81:
{{{1. Open a root console
2. Type "aptitude install <package>" where package is the name of the package (application) you want to install.}}}
Open a root console
{{{
#
aptitude install <package>
}}}
where <package> is the name of the package (application) you want to install.}}}
Line 80: Line 88:
Line 81: Line 90:
{{{aptitude --reinstall install <package_name> {{{
aptitude --reinstall install <package>
Line 83: Line 93:
To reinstall with all dependecies, type:
{{{aptitude --reinstall install $(apt-cache depends --recurse --installed x-window-system ||grep '[ ]')
To reinstall with all dependencies, type:
{{{
#
aptitude --reinstall install $(apt-cache depends --recurse --installed <package> ||grep '[ ]')
Line 86: Line 97:
/!\ wrong! ToDo: correct this
Line 89: Line 101:
{{{1. Open a root console
2. Type "
aptitude remove <package>" where package is the name of the package (application) you want to remove.}}}
{{{
#
aptitude remove <package>
}}}
where <package> is the name of the package (application) you want to remove.}}}
Line 93: Line 107:
Line 95: Line 108:
aptitude purge <package> # aptitude purge <package>
Line 101: Line 114:
2. Type "aptitude install <package>" where package is the name of the package (application) you want to update.}}} {{{
#
aptitude upgrade <package>
}}}
where <package> is the name of the package (application) you want to update.
Line 105: Line 121:
{{{1. Open a root console
2. Type "aptitude update".
3. Type "aptitude upgrade" (does all the "noninterfering" package upgrades).
4. Type "
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".}}}
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".
Line 112: Line 135:
{{{1. Open a console
2. Type "apt-cache search <string>" where <string> is a list of keywords to search for.}}}
Open a console
{{{
$
apt-cache search <string>
}}}
where <string> is a list of keywords to search for.
Line 118: Line 143:
apt-cache search <string> | less $ apt-cache search <string> | less
Line 123: Line 148:
{{{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")}}}
Open a console
{{{
$ dpkg --list
}}}
Line 128: Line 154:

Translation(s): [:Apt en ligne de commande:Français] - [:AptCLIDutch:Nederlands]

(!) [:/Discussion:Discussion]


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

?TableOfContents([3])

(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.)

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:

Open a [:Root: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 [:SourcesList: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: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

Read about how to use apt-spy: type "man apt-spy"

** ToDo 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

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#head-ce8196a32ccb751d41eb2cdd1b66fa97cbc0a80c: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 install <package>

To reinstall with all dependencies, type:

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

/!\ wrong! ToDo: correct this

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

  • ["AptTools"] - Further Apt Tools

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


?CategoryQuickPackageManagement | CategoryPackageManagement