[ zurück ] [ Inhalt ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ weiter ]


APT HOWTO
Kapitel 5 - Paketverwaltung


5.1 Using the Debian Package Manager: aptitude

Debian has long lived with a package manager which was known to be difficult to understand and use, called dselect. The Debian system is now moving towards a new default manager called aptitude, which is also based on the APT library.

If you installed Sarge you will have aptitude installed by default on the base system, otherwise install the aptitude package by running, for example, this command before continuing:

     # apt-get install xchat

Try to avoid using apt-get and use aptitude instead, as it knows much more about what APT is able to do and have some unique features like marking packages that were automatically installed to satisfy dependencies and ask to remove them automatically when they are no longer needed.

aptitude has two main modes: a ncurses-based UI in which you can navigate through a list of packages much like dselect and a command line-based UI, much like apt-get. Most examples in this document use the command line-based UI, giving tips on which command is used to achieve the same results in the aptitude dselect-like UI.

To fire up this UI, type aptitude in a terminal -- there's no need to be root at this time, aptitude will request root powers when it needs them automatically. Let's check out the basics: to access the menubar at the top of the screen you need to press F10, as the second line suggests. This second line has a summary of the most commonly used features like getting help, quiting, updating list of packages and proceeding.

Do take a look at the User Manual which is located at the help menu to understand how the thing works.

Notice that aptitude works in a way similar to other package managers: you make all your selections and then commits the changes. Almost all actions done in managing the instalation of a package will require pressing the g key two times to be effective. The first time you press g you'll be presented with the list of changes being done, then you press g again to confirm the changes or q to go back.

Similarly, you can press the Enter key to get more details about a package or group of packages -- for example, you can press Enter when the selection is on 'New Packages' to see the a list of sections. By pressing Enter on a section you will see the list of new packages in that section and you can see more details on a package by pressing Enter on it. Notice that entering a package's details will change aptitude's view context, so you'll need to press q to go back.

The packages are categorized by default based on their installation status and some other special categories. You'll be seing this when you first enter aptitude

     --- New Packages
     --- Upgradable Packages
     --- Installed Packages
     --- Not Installed Packages
     --- Obsolete and Locally Created Packages
     --- Virtual Packages
     --- Tasks

New Packages has the packages that entered Debian since the last time you cleared your list of new packages using the Forget new packages option in the Actions menu, or the "f" key.

Upgradable Packages are installed packages that have new versions available. Installed Packages are the installed packages proper, Not Installed Packages are the ones you did not install but are available from one of the APT sources. Obsolete and Locally Created Packages are those packages that are no longer available from at least one APT source or the ones you created yourself. Virtual Packages are packages defining a service rather than a particular software and that are "provided" by several specific packages. Finally, Tasks are the collections of packages which serve a specific purpose, also used by the tasksel program.

Pressing Enter on any of those will expand the tree to something like this:

     --\ Not Installed Packages
       --- admin - Administrative utilities (install software, manage users, etc)
       --- base - The Debian base system
     [...]

Going even deeper we'll have:

       --\ games - Games, toys, and fun programs
         --- contrib - Programs which depend on software not in Debian
         --\ main - The main Debian archive
     p     3dchess                                               <none>     0.8.1-10

This shows us one package which is a not installed one, that is a game and that is available from the main Debian repository, which is what the Debian distribution is officially.

On the center of the screen there's a marked line that is filled with some text when you select a package. That is what we call the short description of the package. Below it there's a text box containing more detailed information on the package. That's the long description. Some times the long description is too big to fit the rectangle reserved for it, so you can press the "z" key to scroll it down and "a" to scroll it up again.

Check Installieren von Paketen, Abschnitt 5.4 for more information on the data shown here.


5.2 Update der Liste der verfügbaren Pakete

Das Paketsystem benutzt eine private Datenbank mit Informationen über installierte, nicht installierte und für eine Installation verfügbare Pakete. Das Programm apt-get benutzt diese Datenbank, um herauszufinden, wie es die vom Benutzer angeforderten Pakete installieren soll und welche zusätzlichen Pakete benötigt werden, damit die ausgewählten Pakete ordentlich funktionieren.

Um diese Liste zu updaten, benutzt man das Kommando apt-get update. apt-get sucht dann nach den Paketlisten in den Archiven aus der /etc/apt/sources.list; In Die Datei /etc/apt/sources.list, Abschnitt 4.1 finden Sie weitere Information über diese Datei.

One of the steps that APT takes in updating your database is to verify that the list of packages and their MD5 sums is secure. It does this by verifying a cryptographic signature, and checking some MD5 sums; see APT's chain of trust, Abschnitt 3.3 for more information. If APT finds that the signature is incorrect, or that the MD5 sums do not match, you may get an error while updating your package database. This is to prevent trojaned packages from being installed on your computer. If this occurs, there may be a configuration problem (such as an out-of-date key) which you can solve. Failing this, you should contact the administrator of the apt source that failed.

Es ist eine gute Idee, dieses Kommando regelmäßig auszuführen, um sich selbst und sein System auf dem neusten Stand über mögliche Paket- bzw. Sicherheitsupdates zu halten.


5.3 Pakete entfernen

Aptitude provides a very flexible and powerful search feature. You can access it by pressing the "/" (slash) key. That will open a small dialog on the center of the screen.

You can then type the name of a package. Aptitude will search as you type. If the package it finds is not exactly the one you want you can press enter for the dialog to vanish and then press the "n" key to repeat the search for the same string.

You can use regular expressions[2] on the search dialog, just beware that aptitude has its own search language which sometimes overlaps with the regular expressions' one. Let's move on to an example, then: if you want to have an exact match to the string "gnome" type "^gnome$" on the search dialog.

Notice that when searching like this you are simply searching for the package names. If you want to search for descriptions you need to use "~d" right before the search term. So, if you want to search for all packages mentioning "isolinux" on their descriptions you'd write "~disolinux" at the search dialog.

You can also search for all packages which are currently broken by searching for "~b", search for all the packages which were removed but which configuration files have ben kept searching for "~c".

For more advanced searching on aptitude take a look at Aptitude's User Manual, which you can find inside the Help menu.

Man kann auch den Inhalt von Paketen auflisten:

     $ aptitude search '~c'
     c A abiword-common                  - WYSIWYG word processor based on GTK2
     c A acme                            - Enables the "multimedia buttons" found on
     (...)

As you can see, you can use any aptitude search string when using the command line too, and aptitude provides you some information on the state of the packages that we are going to discuss through this manual.


5.4 Installieren von Paketen

Endlich kommt das, worauf Sie alle gewartet haben! Mit der fertigen sources.list und der Liste der verfügbaren Pakete auf dem neusten Stand ist alles, was Sie zu tun haben apt-get auszuführen, um das gewünschte Paket zu installieren. Zum Beispiel:

When you enter aptitude you can have it install one or more packages by pressing the "+" key while the package in question is selected. You can use the "/" key to search for the package you want, see Pakete entfernen, Abschnitt 5.3. When you request the installation of a package it will be marked with a green color and the line will look like in this example:

     pi    celestia-gnome                                        <none>     1.3.0-1

This means that the package is not installed ('p') and is marked for installation. The word <none> means no version is installed and the version number after it is the one that is being marked for installation.

Notice that when you do that other packages will be marked for installation automatically. Those are the dependencies, suggestions and recommendations of the selected package. They will most probably be marked like this:

     piA   gnome-bin                                             <none>     1.4.2-16

The uppercased 'A' means that this package is being installed because another package depends on it. All packages installed like that will be removed when no longer needed. You can have that mark set manually by typing "M" with the cursor positioned at a package.

A 'U' sign at the forth column means that package comes from an untrusted source, which means there's no signed Release file for the source that package comes from or its public key has not been imported into APT's keyring. See Installieren von Paketen, Abschnitt 4.2 to understand what you should do to have that source be trusted. You may have that same package in one of the trusted sources too, though, so you may want to take a look at the detailed information about available versions of that package.

You can have detailed information about the package you want to install by pressing Enter while the package is selected. This will bring you to something like this:

     i A --\ xterm                                             4.2.1-14     4.2.1-14
       Description
     xterm - X terminal emulator
     xterm is a terminal emulator for the X Window System.  It provides DEC VT102
     and Tektronix 4014 compatible terminals for programs that cannot use the
     window system directly.  This version implements ISO/ANSI colors and most of
     the control sequences used by DEC VT220 terminals.
       Priority: optional
       Section: x11
       Maintainer: Branden Robinson <branden@debian.org>
       Compressed size: 547k
       Uncompressed size: 1130k
       Source Package: xfree86
       --\ Depends
         --- libc6 (>= 2.3.2.ds1-4)
         --- libfreetype6 (>= 2.1.5-1)
         --- libncurses5 (>= 5.3.20030510-1)
         --- libxaw7 (> 4.1.0)
         --- xlibs (> 4.1.0)
         --- xlibs (> 4.2.0)
       --\ Conflicts
         --- xbase (< 3.3.2.3a-2)
         --- suidmanager (< 0.50)
       --\ Replaces
         --- xbase (< 3.3.2.3a-2)
       --- Packages which depend on xterm
       --\ Versions
     p A 4.3.0-0pre1v4
     i A 4.2.1-14

Those versions which are trusted will not have the 'U' letter at the forth column, so you just pick the one you want and tell aptitude to install. Our example above has different versions coming from trusted sources.

Notice that almost always, when you see three or more dashes you can press Enter to have it expand. It will then become something like --\. You now have plenty of information on this package, like what packages it depends on and which it conflicts[3], for example.

Also notice that at the end of the screen (you can go down using the arrow keys or page down) you'll find the different Versions available for that package. The xterm package has two available versions for me, because I have more than one APT source providing it at different versions.

You can install the version you want by pressing "+" on it. Remeber that you need to ask aptitude to proceed with the marks you have made. You do that by pressing "g". Aptitude will then show a list of actions it's going to perform where you can see if it is doing what you want:

     --\ Packages being automatically installed to satisfy dependencies
     ciA calctool                                                <none>     4.3.16-2
     --\ Packages being held back
     ih  libgnomeprintui2.2-0                                   2.4.0-1     2.4.2-1
     --\ Packages to be installed
     pi  gwget2                                                  <none>     0.7-3
     --\ Packages to be removed
     ip  qvwm                                                1:1.1.12-1     1:1.1.12-1

The entries should be easily understandable. The new thing here is a package being held back. You can read more about that in Pakete entfernen, Abschnitt 5.9. After checking the changes are the ones you wish confirm the selections by pressing the "g" key again.

aptitude will now start the process of downloading and installing the packages you have selected. APT may also start upgrading any packages that need to be upgraded at this time (see Upgrade von Paketen, Abschnitt 5.7). If you have selected packages from untrusted sources aptitude will show you a list of those packages and prompt you before starting to obtain the packages whether you really want to install them. See APT's chain of trust, Abschnitt 3.3 for more information on secure sources.

If you want to reinstall a package, say, to have files you removed by accident recovered or something you can press the "L" key to mark it for reinstallation. You'll then go through the same process as if you were installing it.

You can also use aptitude without the interactive UI to install or reinstall packages like this:

     # aptitude install package1 package2 ...
     # aptitude --reinstall install package1 package2 ...

5.5 Installing manually downloaded or locally created debian packages

If you have downloaded a .deb file manually from the internet or has got a .deb from any source other than using APT you will not be able to use aptitude or any other APT-based program to install it.

You'll then need to use the underlying package management tool, which is the one that actually does the hard work of installing packages -- even aptitude calls this tool for installing: dpkg.

Man kann auch den Inhalt von Paketen auflisten:

     # dpkg -i Datei.deb

If you want to use the unstable branch of Debian or wishes to create Debian packages you better learn more about dpkg! It's a very powerful tool and has many useful options.


5.6 Pakete entfernen

Wenn ein Paket nicht mehr gebraucht wird, kann es mit APT vom System entfernt werden. Geben Sie einfach apt-get remove package ein. Zum Beispiel:

     id    celestia-gnome                                       1.3.0-1     1.3.0-1

Notice that this will result in a line that looks like this, after the package is removed:

     c    ocaml-base                                             <none>     3.07.2a-1

There's a c at the beginning of the line, instead of a p. This means that, in my system, the ocaml-base package was removed but the configuration files are still hanging around. To remove the package with its configuration files you have to use the "_" key[4], instead -- that's called purge.

One important note: if you try to remove a package which is a dependency of an installed package you'll end up having broken packages, as the top of the aptitude screen shows:

     aptitude 0.2.13      #Broken: 1   Will free 208MB of disk space

The broken packages will be marked like this:

     iBA   openoffice.org                                       1.1.0-3     1.1.0-3

You can try to solve the brokeness for yourself, by having the ofending packages removed as well, so that no broken depends are left or ask aptitude to proceed, pressing the "g" key. It will then try to fix all the brokeness. If the solution taken by the program does not satisfy your wishes you can manually fix it before confirming with "g".

You can search for broken packages typing "/" and using "~b" as search string and pressing Enter, you can then search for the next match using the "\" key. You can search broken packages by simply pressing the "b" key, also; pressing it again will show you the next broken package. See Getting information about packages., Kapitel 7 for more information on finding packages.

As usual, you can have packages removed or purged through the command line interface like this:

     # aptitude remove package1 package2 ...
     # aptitude purge package1 package2 ...

5.7 Upgrade von Paketen

Package upgrades are a great success of the APT system. Aptitude will automatically mark the packages that have newer versions for upgrade so all you have to do to upgrade your system is, usually, update the lists of packages (see Update der Liste der verfügbaren Pakete, Abschnitt 5.2) and then ask aptitude to proceed, by typing "g" and, after reviewing the changes, confirming with "g", again. If aptitude is not marking the upgrades automaticaly you can press the "U" (upper "u") key to ask it to. This is a configuration option which lives on the Options->Misc menu.

You can check the list of packages that have new versions available looking at the Upgradable Packages category:

     --\ Upgradable Packages
       --\ libs - Collections of software routines
         --\ main - The main Debian archive
     iu    libgnomeprintui2.2-0                                 2.4.0-1     2.4.2-1

Packages marked for upgrade have their lines cyan-colored and have the character u as the action that is going to be performed. If you want to upgrade to a new release, then take a look at the next section, Upgrade einer Debian-Version, Abschnitt 5.8.


5.8 Upgrade einer Debian-Version

Diese Funktion erlaubt es, ein ganzes Debian-System entweder über das Internet oder von einer neuen CD (die Sie kaufen oder aus dem Internet herunterladen können) auf einmal zu aktualisieren.

Wenn auf Ihrem System z.B. Revision 0 der stabilen Debian-Version läuft und Sie sich Revision 3 auf CD kaufen, können Sie APT benutzen, um ein Upgrade auf die neue Version von CD durchzuführen. Dafür benutzen Sie apt-cdrom (Siehe Abschnitt Hinzufügen einer CD-ROM in die sources.list, Abschnitt 4.3), um die CD zu Ihrer /etc/apt/sources.list hinzuzufügen und führen Sie apt-get dist-upgrade aus.

Es ist wichtig zu wissen, daß APT immer nach der aktuellsten Version eines Pakets sucht. Wenn also Ihre /etc/apt/sources.list auf ein Archiv zeigt, das eine neuere Version eines Pakets enthält als sich auf der CD befindet, lädt APT das Paket aus diesem herunter.

If you want to update your system from the Internet you only need to setup the /etc/apt/sources.list file accordingly. Upgrading to a new stable release is usually just a matter of running the normal upgrade process on aptitude. If your /etc/apt/sources.list uses the release codename[5] you'll need to update it to the new name or change it to `stable'.

So, for example, this line:

     deb http://http.us.debian.org/debian sarge main

Would have to read like one of the following as soon as Etch is released as stable for the computer to be kept up-to-date with the current stable system:

     deb http://http.us.debian.org/debian etch main
     deb http://http.us.debian.org/debian stable main

The difference here is that the first one will keep you at etch as long as you wish, even if a new stable comes out. This may be useful if you want to decide when to upgrade to the new stable. The second example will automatically update your box to the new stable when it is released.


5.9 Pakete entfernen

As we saw on the previous section, aptitude will automatically mark packages for upgrade. If you want to keep the current version installed, though, you can ask it to put the package on hold.

This is achieved by pressing the "=" key. Packages being held from upgrades will look like this:

     ih    alien                                                   8.41     8.41

In this example, the alien package will be kept at version 8.41 even if a new version appears on an APT source -- notice the h character at the left. To have it upgraded/upgradable again just mark it for installation.

Man kann auch den Inhalt von Paketen auflisten:

     # apt-cache showscrc Paket

5.10 Ungenutzte Pakete entfernen: apt-get clean and autoclean

Wenn ein Paket installiert werden soll, bezieht APT von den Quellen, die in der /etc/apt/sources.list aufgelistet sind, die nötigen Dateien, legt sie in ein lokales Archiv (/var/cache/apt/archives/) und fährt mit der Installation fort. (sehen Sie Installieren von Paketen, Abschnitt 5.4).

Nach und nach kann dieses lokale Archiv immer größer werden und eine Menge Platz auf der Festplatte belegen. Auch für diesen Fall bietet APT Werkzeuge an, um sein lokales Archiv zu warten: apt-gets clean und autoclean Methoden.

The clean method is invoked through the Clean package cache menu item in the Actions menu. It is used to delete all the .deb files downloaded. The autoclean method is invoked through the Clean obsolete files option, also in the Actions menu.

The autoclean method is to be used by those who like to keep a local copy of the packages currently installed, mostly. It only deletes those .deb files which are no longer provided by any APT source and are, thus, obsoleted by a newer version.


[ zurück ] [ Inhalt ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ weiter ]


APT HOWTO

2.0.2 - October 2006

Gustavo Noronha Silva kov@debian.org
Deutsche Übersetzung: David Spreen netzwurm@debian.org