[ önceki ] [ İçindekiler ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ sonraki ]


APT NASIL
Bölüm 4 - Paketlerin yönetimi


4.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 Paket kurma, Kısım 4.4 for more information on the data shown here.


4.2 Paket listesini güncelleme

The packaging system uses a private database to keep track of which packages are installed, which are not installed and which are available for installation. The aptitude program uses this database to find out how to install packages requested by the user and to find out which additional packages are needed in order for a selected package to work properly.

Bu listeyi güncellemek için apt-get update komutunu kullanmalısınız. Bu komut /etc/apt/sources.list dosyanıza bakar ve belirtilen arşivlerden güncel paket listesini indirir; ayrıntılı bilgi için bkz. /etc/apt/sources.list dosyası, Kısım 3.1.

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, Kısım 2.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.

Paket güncellemeri ve güvenlikle ilgili güncellemelerden sizin ve sisteminizin haberdar olabilmesi için bu komutu düzenli aralıklarla çalıştırmakta fayda vardır.


4.3 Paket kaldırma

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.

Bir paketin içeriğini aşağıdaki komutla listeleyebilirsiniz:

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


4.4 Paket kurma

Sonunda sabırsızlıkla beklediğiniz bölüme geldik! Artık sources.list dosyanız hazır ve paket listeniz güncel durumda. Tek yapmanız gereken kuracağınız paketi belirtmek. Örneğin:

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 Paket kaldırma, Kısım 4.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 Paket kurma, Kısım 3.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 Paket kaldırma, Kısım 4.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 Paket güncelleme, Kısım 4.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, Kısım 2.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 ...

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

Bir paketin içeriğini aşağıdaki komutla listeleyebilirsiniz:

     # dpkg -i file.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.


4.6 Paket kaldırma

Bir paketi artık kullanmak istemiyorsanız APT ile sisteminizden paketi kaldırabilirsiniz. Bunun için apt-get remove package komutunu vermeniz yeterli olacaktır. Örneğin:

     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 Paketler hakkında bilgi toplama, Bölüm 6 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 ...

4.7 Paket güncelleme

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 Paket listesini güncelleme, Kısım 4.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, Yeni bir sürüme güncelleme, Kısım 4.8.


4.8 Yeni bir sürüme güncelleme

APT'nin bu özelliği sayesinde bir defada tüm sisteminizi yeni bir Debian sürümüne ister internet üzerinden isterse varolan bir CD üzerinden yükseltebilirsiniz.

For example, suppose that you're using revision 0 of the stable version of Debian and you buy a CD with revision 3. You can use APT to upgrade your system from this new CD. To do this, use apt-cdrom (see section sources.list dosyasına CD-ROM ekleme, Kısım 3.3) to add the CD to your /etc/apt/sources.list and run aptitude to proceed with the instalation, as described above.

Unutmayın, APT her zaman paketin güncel versiyonunu arar. Eğer /etc/apt/sources.list dosyanızda belirtilen arşivlerde bir paketin CD üzerindekinden daha yeni bir versiyonu var ise güncelleme sırasında bu versiyon kullanılacaktır.

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.


4.9 Paket kaldırma

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.

Bir paketin içeriğini aşağıdaki komutla listeleyebilirsiniz:

     # apt-cache showsrc paket_adı

4.10 Kullanılmayan paket dosyalarını temizleme: apt-get clean ve autoclean

Bir paket kuracağınız zaman APT gerekli dosyaları /etc/apt/sources.list dosyanızda belirtilen host'lardan alır ve yerel bir dizin (/var/cache/apt/archives/) altında saklar. Ardından kurulumu buradaki dosyalar üzerinden gerçekleştirir, bkz. Paket kurma, Kısım 4.4.

Zamanla dosyaların tutulduğu yerel dizinin boyutları artmaya ve gereksiz yer kaplamaya başlar. APT bu dizini temizlemek için bir takım fonksiyonlara sahiptir: apt-get'in clean ve autoclean seçenekleri.

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.


[ önceki ] [ İçindekiler ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ sonraki ]


APT NASIL

2.0.2 - October 2006

Gustavo Noronha Silva kov@debian.org
Çeviri: Murat Demirten murat@debian.org