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


APT NASIL
Bölüm 7 - Tricks and Techniques


7.1 Programları anında kurma

Bir program derliyorsunuz ve aniden bir hata oluştu! Çünkü program sisteminizde olmayan bir .h dosyasına ihtiyaç duyuyor. auto-apt programı sizi bu senaryolardan kurtaracaktır. Gerektiğinde ilgili paketi kurmak isteyip istemediğinizi soracak, derleme işlemini durduracak ve programı çekip kurduktan sonra derleme işleminin devam etmesini sağlayacaktır.

Peki nasıl yapacaksınız:

     # auto-apt run command

Where command is the command to be executed that may need some unavailable file. For example:

     # auto-apt run ./configure

Ardından gerekli paketleri kurmak isteyip istemediğinizi soracak, apt-get'i çağırarak kurulumları otomatik olarak gerçekleştirecektir.

Auto-apt programı efektif olarak çalışabilmek için kendi özel veritabanını tutar. Bu veritabanının güncel tutulması programın beklenilen davranışı gösterebilmesi açısından önemlidir. Veritabanını güncellemek için auto-apt update, auto-apt updatedb ve auto-apt update-local komutlarını çalıştırmalısınız.


7.2 Paketlerin yönetimi

If you are dealing with several machines in a network it might be useful to have a package caching system, so that you will not have to download the packages for each machine. This manual will focus on the apt-proxy package, which does exactly that. Other solutions exist, like apt-cacher, though. You may want to try each one to choose the one that best fits your needs.

First of all, install the apt-proxy package. It will register itself on inetd to listen for requests on port 9999, you may need to restart the inetd service.

Next you'll want to edit the /etc/apt-proxy/apt-proxy.conf file. It lists the real servers apt-proxy will use to download the package lists and packages from. You can use http, ftp and rsync as transfer methods. The file comes with a default "backend" that looks like this:

     add_backend /debian/                                    \
             $APT_PROXY_CACHE/debian/                        \
             http://ftp.us.debian.org/debian/                \
             http://ftp.de.debian.org/debian/                \
             http://ftp.uk.debian.org/debian/                \
             +ftp.us.debian.org::debian/

This means that whenever a client tries to get something from /debian/ apt-proxy will use its cache, the listed Debian http mirrors and one rsync server, which is preferred for downloading the package lists (the "+" sign means prefered for control files).

How, then, a client will use this backend? By adding the following line at the /etc/apt/sources.list file at the clients (including the box in which apt-proxy is installed):

     deb http://server:9999/debian/ stable main

The line looks much like a normal line. The difference here is you put your apt-proxy server where you would normally put an http or ftp mirror, uses a port value (9999) and then select the backend (/debian/). After having done all this initial setup update the list of packages at one of the machines and upgrade it first, so that it will only download a package one time. After the first machine is up-to-date update the others.

You can use the apt-proxy-import command to import the packages that are inside your current APT cache (/var/cache/apt/archives/) by running apt-proxy-import /var/cache/apt/archives. Notice that you must have run the update process in at least one client to initiate the apt-proxy's cache before using apt-proxy-import.

You can learn more about apt-proxy by reading the comments that populate the /etc/apt-proxy/apt-proxy.conf file. To setup http and ftp proxies for apt-proxy to use, for example, you will find example configurations at the end of the file.


7.3 sources.list dosyası için en iyi yansıya karar verme: netselect, netselect-apt

A very frequent question, mainly among the newest users, is: "which Debian mirror to include in sources.list?". There are many ways to decide which mirror. The experts probably have a script that measures the ping time through the several mirrors. But there's a program that does this for us: netselect.

netselect programını bildiğimiz yöntemle kuralım:

     # apt-get install netselect

Parametre vermeden programı çalıştırdığımızda bir yardım sayfası gözükecektir. Programı birbirinden boşluk karakteri ile ayrılmış yansı adresleriyle çalıştırırsanız geriye bir skor ve yansı adresi döndürecektir. Buradaki değer yaklaşık olarak ping zamanını, ve ilgili yansıya kaç adımda ulaşılabilindiği bilgisiyle hesaplanmıştır. Eğer parametre olarak verdiğiniz tüm yansılara ait skorları görmek isterseniz programı -vv seçeneği ile çalıştırabilirsiniz. Örnek:

     # netselect ftp.debian.org http.us.debian.org ftp.at.debian.org download.unesp.br ftp.debian.org.br
       365 ftp.debian.org.br
     #

Bu çıktının anlamı, netselect programına parametre olarak verdiğimiz yansılar arasından en uygununun ftp.debian.org.br olduğu ve bu yansı için elde edilen skor değerinin 365 olduğudur. (Bu değer herkes için farklı olacaktır!).

Şimdi netselect tarafından en hızlı olarak belirtilen yansıyı /etc/apt/sources.list dosyanıza (bkz. /etc/apt/sources.list dosyası, Kısım 3.1) ekleyebilir ve ardından Paketlerin yönetimi, Bölüm 4 kısmındaki yönergeleri takip edebilirsiniz.

Not: Debian tam yansı listesine http://www.debian.org/mirror/mirrors_full adresinden erişebilirsiniz.

Beginning with the 0.3 version, netselect package includes the netselect-apt script, which makes the process above automatic. Just enter the distribution tree as parameter (the default is stable) and the sources.list file will be generated with the best main mirror and will be saved under the current directory. The following example generates a sources.list of the stable distribution:

     # ls sources.list
     ls: sources.list: Böyle bir dosya ya da dizin yok
     # netselect-apt stable
     (...) Bir miktar bekliyoruz
     # ls -l sources.list
     sources.list
     #

Unutmayın: sources.list dosyası bulunduğunuz dizin altında oluşturulacaktır. Bu dosyayı kullanmak istiyorsanız /etc/apt dizini altına taşımalısınız.


7.4 Kullanılmayan yerelleştirme dosyalarını kaldırma: localepurge

Çoğu Debian kullanıcısı sadece bir tip yerel dosyası kullanır. Örneğin bir Türk genellikle tr_TR yerelini kullanır ve hemen hiç bir zaman es kullanma ihtiyacı hissetmez.

localepurge paketi bu kullanıcılar için oldukça faydalıdır. Kullanmadığınız yerellerin sisteminizden kaldırılmasını ve yenilerinin de kurulmamasını sağlayarak disk üzerinde size yer kazandırır. Yapmanız gerekeni biliyorsunuz: apt-get install localepurge

Paketin ayarlamaları oldukça kolaydır, debconf tarafından ilgili sorular size yöneltilecektir. Ancak ilk soruya cevap verirken dikkatli olun, yanlış bir seçim sonucu kullandığınız yerel dosyalarının silinmesine neden olabilirsiniz. Bu durumda tek çözüm, ilgili yerel dosyalarını içeren paketleri sisteminize yeniden kurmak olacaktır.


7.5 Paketlerdeki değişikliklerden haberdar olma

Sisteminize kurulan her paket kendi dokümantasyon dizini altına (/usr/share/doc/paket_adı) changelog.Debian.gz adlı bir dosya atar. Bu dosyada ilk versiyondan son versiyona kadar paket üzerinde yapılan değişiklikler belirtilir. Bu dosyayı zless ile okuyabilirsiniz ancak tüm paketleri bu şekilde takip etmek epey güç bir uğraştır.

Bu işi otomatik hale getirmek için yardımcı bir araç mevcuttur: apt-listchanges. Programı kullanmak için önce apt-listchanges paketini sisteminize kurmalısınız. Kurulum esnasında Debconf tarafından sorulan soruları istediğiniz gibi yanıtlayabilirsiniz.

"Should apt-listchanges be automatically run by apt?" seçeneği oldukça yararlıdır, bu seçenek ile paket kurulum ve güncellemelerinde, paketteki değişiklikleri görebilirsiniz. "Should apt-listchanges prompt for confirmation after displaying changes?" seçeneği ile değişiklikleri okuduktan sonra programın kurulumu işlemine onay istenmesini sağlayabilirsiniz. Eğer devam etmek istemediğinizi söylerseniz apt-listchanges bir hata kodu döndürür ve apt-get işlemi sonlandırır.

After apt-listchanges is installed, as soon as packages are downloaded (or gotten from a CD or mounted disk) by apt it will show the lists of changes made to those packages before installing them.


[ ö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