Jedan mali APT-Guide
Što znači apt?
APT je kratica za Advanced Packaging Tool i sastoji se od kolekcije programa i skriptova koje pomažu sysadministratoru (u vašem slučaju root) s instalacijom i menadžmentom deb-datoteka, čak i sistemu da zna što je instalirano.
Sources List
APT is short for Advanced Packaging Tool and is a collection of programs and scripts that help both the sysadmin (in your case root) with the installation and management of deb-files but equally the system itself to know what is installed.
Eros-pre2 installations forward
Eros-pre2 installations forward deals with /etc/apt/sources.list differently, namely it is empty. In its place is a directory or folder named:
/etc/apt/sources.list.d/
Inside the folder are 2 files called:
/etc/apt/sources.list.d/debian.list and
/etc/apt/sources.list.d/sidux.list
This has the benefit of easier (automated) mirror switching, and makes it safer to replace lists.
You can also add your own /etc/apt/sources.list.d/*.list files
Eros-pre1, Gaia, Tartaros and Chaos installations
The sources list is found in/etc/apt/sources.list
sidux ISOs koriste sljedeću sources.list kao standard:
# Free University Berlin/ spline (Student Project LInux NEtwork), Germany deb ftp://ftp.spline.de/pub/sidux/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free #deb-src ftp://ftp.spline.de/pub/sidux/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free
Dodatni podatci za non-free potrebe možete naći uvijek u našoj, stalno ponovljenoj sidux.list and debian.list 28/02/2008 0800 sati UTC to su:
# See sources.list(5) for more information, especially # Remember that you can only use http, ftp or file URIs # CDROMs are managed through the apt-cdrom tool. # The /etc/apt/sources.list.d/ directory provides a way to add sources.list # entries in separate files that end with sources.list file. # Unstable deb http://ftp.us.debian.org/debian/ unstable main contrib non-free #deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free # Testing #deb http://ftp.us.debian.org/debian/ testing main contrib non-free #deb-src http://ftp.us.debian.org/debian/ testing main contrib non-free # Experimental #deb http://ftp.us.debian.org/debian/ experimental main contrib non-free #deb-src http://ftp.us.debian.org/debian/ experimental main contrib non-free # Free University Berlin/ spline (Student Project LInux NEtwork), Germany deb ftp://ftp.spline.de/pub/sidux/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free #deb-src ftp://ftp.spline.de/pub/sidux/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free
Bilješka: U ovom primjeru ftp.us označuje da koristi njemačke repozitorije. Možete editirati tu datoteku, kao root, da koristite najbliže repozitorije, samo promijenite zemlju, promijenite ftp.us sa ftp.nl, ili ftp.uk. Većina zemalja ima lokalne mirrore. Iskoristivost pojasne širine je sačuvana; brzine poboljšane.
Da vam je moguće da dobijete najnovije informacije o paketima koje APT koristi. Ta baza podataka sadrži pakete ali isto sadrži funkcijske zavisnosti za druge pakete, koje su korištene da programi rade kako treba. Program apt-get koristi tu bazu podataka kad instalira vaše izabrane pakete i riješi funkcijske zavisnosti, i tako garantirah da paketi rade kako treba. Ponavljanje te baze podataka obavite s naredbom apt-get update.
# apt-get update (which returns) Get:1 http://sidux.com sid Release.gpg [189B] Get:2 http://sidux.com sid Release.gpg [189B] Get:3 http://sidux.com sid Release.gpg [189B] Get:4 http://ftp.de.debian.org unstable Release.gpg [189B] Get:5 http://sidux.com sid Release [34.1kB] Get:6 http://ftp.de.debian.org unstable Release [79.6kB]
Instalirati novi paket
Pretpostavljamo da je apt-baza podataka na novom stanju i ime paketa poznato, onda sljedeća naredba će instalirati paket zvan qemu i sve funkcijske zavisnosti: (poslije ćemo još vidjeti kako se traže paketi.)
# apt-geta install qemu Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: bochsbios openhackware proll vgabios Recommended packages: debootstrap vde The following NEW packages will be installed: bochsbios openhackware proll qemu vgabios 0 upgraded, 5 newly installed, 0 to remove and 20 not upgraded. Need to get 4152kB of archives. After unpacking 11.9MB of additional disk space will be used. Do you want to continue [Y/n]? n
Izbrisati paket
Slično, nije veliko iznenađenje da će sljedeće deinstalirati qemu i gaim, kako god, neće izbrisati funkcijske zavisnosti koje su instalirane prije, to će mo kasnije obaviti s deb-orphan
# apt-get remove qemu gaim Reading package lists... Done Building dependency tree... Done The following packages will be REMOVED: qemu gaim gaim-irchelper 0 upgraded, 0 newly installed, 3 to remove and 310 not upgraded. Need to get 0B of archives. After unpacking 4743kB disk space will be freed. Do you want to continue [Y/n]? (Reading database ... 174409 files and directories currently installed.) Removing gaim-irchelper ... Removing gaim ... Removing qemu ...
U tom zadnjem slučaju config-datoteke od paketa "gaim" (kako je postavljeno) nisu izbrisane sa sistema. Možete ih koristiti kad ponovo instalirate isti paket, i onda će raditi sa tim postavkama
Ako hoćete da izbrišete config-datoteke, upišite naredbu:
# apt-get remove --purge gaim Reading package lists... Done Building dependency tree... Done The following packages will be REMOVED: gaim* 0 upgraded, 0 newly installed, 1 to remove and 309 not upgraded. Need to get 0B of archives. After unpacking 4678kB disk space will be freed. Do you want to continue [Y/n]? Y (Reading database ... 174405 files and directories currently installed.) Removing gaim ... Purging configuration files for gaim ...
Ovdje nije samo datoteka /etc/gaim izbrisana, nego sve config-datoteke su izbačene/izbrisane, AKO jedna aplikacija sadrži datoteke koje nisu kreirane s instalacijom, ostati će na sistemu.
Poslije ponavljanja baze podataka, možemo pronaći koji paketi imaju nove/novije verzije: (first install apt-show-versions)
# apt-show-versions -u libpam-runtime/unstable upgradeable from 0.79-1 to 0.79-3 passwd/unstable upgradeable from 1:4.0.12-5 to 1:4.0.12-6 teclasat/unstable upgradeable from 0.7m02-1 to 0.7n01-1 libpam-modules/unstable upgradeable from 0.79-1 to 0.79-3 fonts-ttf-west-european/unstable upgradeable from 1.3-9 to 1.3-1-1 fonts-ttf-decoratives/unstable upgradeable from 1.3-1 to 1.3-1-1 sysv-rc/unstable upgradeable from 2.86.ds1-3 to 2.86.ds1-4 libpam0g/unstable upgradeable from 0.79-1 to 0.79-3 unionfs-utils/unstable upgradeable from 1.0.14+cvs2005092318w-M1 to 1.0.14+cvs2005092908w-M1libpam-runtime/unstable upgradeable from 0.79-1 to 0.79-3 passwd/unstable upgradeable from 1:4.0.12-5 to 1:4.0.12-6 teclasat/unstable upgradeable from 0.7m02-1 to 0.7n01-1 libpam-modules/unstable upgradeable from 0.79-1 to 0.79-3 fonts-ttf-west-european/unstable upgradeable from 1.3-9 to 1.3-1-1 fonts-ttf-decoratives/unstable upgradeable from 1.3-1 to 1.3-1-1 sysv-rc/unstable upgradeable from 2.86.ds1-3 to 2.86.ds1-4 libpam0g/unstable upgradeable from 0.79-1 to 0.79-3 unionfs-utils/unstable upgradeable from 1.0.14+cvs2005092318w-M1 to 1.0.14+cvs2005092908w-M1
Obnavljanje jednog paketa uključujući funkcijske zavisnosti možete na primjer (za gcc-4.0) obaviti sa:
apt-get install gcc-4.0 Reading package lists... Done Building dependency tree... Done gcc-4.0 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and xxx not upgraded
Downgrade/Hold jednog paketa
Ponekad je potrebno da se vratite na prijašnu verziju jednog paketa, due to a velikog buga sa naj novijom verzijom koju ste baš instalirali.
Hold
echo package hold|dpkg --set-selections
To take a package off Hold
echo package install|dpkg --set-selections
To list packages on hold:
dpkg --get-selections | grep hold
Downgrading
Ovdje će mo koristiti kmahjongg kao primjer:
aktivirajte/izbrišite "#" izpred testing sources u /etc/apt/sources.list
(izbrišite #) tako da vidite sada
deb http://ftp.nl.debian.org/debian/ testing main contrib non-freeapt-get update
apt-get install -t testing kmahjongg
Postavite novo instalirani paket na hold sa:
echo kmahjongg hold|dpkg --set-selectionsupišite opet "#" izpred testing sources u /etc/apt/sources.list
apt-get update
Ako hočete da instalirate naj noviju verziju paketa izvodite ovo:
echo kmahjongg install|dpkg --set-selections apt-get update apt-get install kmahjongg
Upgrade instaliranog sistema - dist-upgrade
If the whole system is to be upgraded this is achieved through a dist-upgrade. You should always check Current Warnings on the sidux main web site, and check the warnings against the packages that your system wants to dist-upgrade. If you need to hold a package refer to Downgrade and Hold a package
An 'upgrade' only of 'debian sid' is not recommended.
Frequency of a dist-upgrade
dist-upgrade as routinely as you can, ideally once every week or two, at least 1 time per month to be safe. A dist-upgrade initiated only every 2 to 3 months should be considered the safe outer limit. For non-standard packages, or self compiled packages, you need to be much more careful with upgrading, since those may break your system at any time due to incompatibilities.
Just downloading
A little known and great option to do a check for what packages are in a dist-upgrade is the -d flag:
apt-get dist-upgrade -d
The -d allows you to download the dist-upgrade without installing it whilst in X from the konsole and allows you to do the dist-upgrade in init 3 at a later time. This also gives you the chance to check warnings against the list as it wisely gives you the option to proceed or abort like this
apt-get dist-upgrade -d
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
elinks-data
The following packages have been kept back:
git-core git-gui git-svn gitk icedove libmpich1.0ldbl
The following packages will be upgraded:
alsa-base bsdutils ceni configure-ndiswrapper debhelper
discover1-data elinks file fuse-utils gnucash
gnucash-common initscripts isdnutils-base libaprutil1
libcapi20-3 libdvdread3 libfuse2 libmagic1 libvlc0
linux-sound-base locales mount mozilla-plugin-vlc
python-glade2 python-gtk2 siduxcc siduxcc-common strace
sysv-rc sysvinit sysvinit-utils tzdata util-linux vlc
vlc-nox
35 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 23.4MB of archives.
After this operation, 594kB of additional disk space will be used.
Do you want to continue [Y/n]?
Y will download the upgraded packages without touching the installed system
After the 'dist-upgrade -d' has downloaded, and wish to complete the dist-upgrade, immediately or at a later time, please follow these instructions:
NIKADA nemojte obaviti dist-upgrade niti upgrade dok ste u X. Uvijek provjerite aktualna upozorenja na glavnoj sidux web site. Ta upozorenja su tu, zato što je Debian sid/nestabilan i ponovljen je svaki dan. Odjavite se od KDE. Uđite u tekst-modus s Ctrl+Alt+F1 ; prijavite se kao root, i onda upišite init 3 ; apt-get update ; apt-get dist-upgrade ; izvodite fglrx ili nvidia skript ako je xorg ponovljen i imate takvu grafičku karticu, ako ne onda upišite: init 5 && exit [NIKADA NEMOJTE OBAVITI DIST-UPGRADE [ili UPGRADE] s adept, aptitude ili synaptic].:
Ako ne uđete u init 3, to je vaš problem, upozorili smo vas!!!!!!!!!!!!!
Razlozi zašto da NE koristite nista drugo osim apt-get za dist-upgrade
Paket menadžeri kao adept, aptitude, synaptic i kpackage ne mogu uvijek da savladaju veliki broj promjena koje se dešavaju u Sid (promjene ovisnosti, promjene imena, promjene maintainer skriptova, ...). To nije pogreška developera, oni napišu ekscelentne alate za debian stable, oni samo ne pašu za specijalne potrebe za Debian Sid.
Koristite sto god hoćete za traženje paketa, ali koristite samo apt-get za instaliranje/brisanje/dist-upgrade
Paket menadžeri kao adept, aptitude, synaptic i kpackage nije predodređen (za kompleksan izbor paketa), za naglo premještanje Sida i još gore je kad koristite vanjske nekvalitetne repozitorije (mi ih ne koristimo niti ih preporučujemo, ali oni su stvarnost na sistemima korisnika) i vi će te imati problema. Druga strana zabilježite si da ti GUI paket menadžeri potrebaju init 5 da rade, i/ili, u X, i izvođenje dist-upgrade-a u init 5 i/ili X , (ili sami 'upgrade' koje nije preporučeno), završiti će te sa sistemom u kvaru; možda ne danas ili sutra, ali je sigurno da će se desiti.
apt-get striktno radi što vi hoćete od njega da obavi, ako postoji problem možete ga lokalizirati i srediti taj slučaj, ako apt-get hoće da izbriše pola sistema (zbog library prijelaza) u vašim rukama je da to sredite, i pogledate dobro.
To je razlog zašto debian gradnje koriste apt-get, i ne druge paket menadžere.
Tražiti paket s apt-cache
Druga vrlo korisna naredba u APT-sistemu je apt-cache; to pretraži APT-bazu podataka i prikazuje informacije o paketima; na primjer listu svih paketa, koje sadržavaju ili adresiraju prema "sidux" i "manual" dobijete sa:
$ apt-cache search sidux manual sidux-manual-de - the official de sidux manual sidux-manual-ro - the official ro sidux manual sidux-manual-hr - the official hr sidux manual sidux-manual-common - the official sidux manual - common files sidux-manual-en - the official en sidux manual sidux-manual-ru - the official ru sidux manual sidux-manual-dk - the official dk sidux manual sidux-manual - the official sidux manual - all languages sidux-manual-nl - the official nl sidux manual sidux-manual-es - the official es sidux manual
Ako su vam potrebne informacije o jednim specijalnom paketu, možete koristiti:
$ apt-cache show sidux-manual-en Package: sidux-manual-en Priority: optional Section: doc Installed-Size: 1088 Maintainer: Kel Modderman <kel@otaku42.de> Architecture: all Source: sidux-manual Version: 01.12.2007.06.03-1 Depends: sidux-manual-common Filename: pool/main/s/sidux-manual/sidux-manual-en_01.12.2007.06.03-1_all.deb Size: 391222 MD5sum: 60f2175c3c5709745a4b4256ccc3c49d SHA1: e275a0b27628b6aa210a4ced48d3646b438e78b8 SHA256: 2792580c7a091521301064180a1d0d8901f0a4af407b90432b9f8d8b6b3603ca Description: the official en sidux manual This manual is divided into common sections, for example, a subject pertaining to partitioning is found in Partitioning your Hard Drive, and topics regarding the Internet/WIFI are grouped in Internet and Networking. There are some topics that cannot be grouped or require stand-alone status. . As with any new documentation there will be errors/mistakes/typos, although we hope otherwise regarding errors and mistakes (typos we can live with) please forgive us. . As the body of work grows, more documentation will be added and we at sidux are sure that this will prove to be a very valuable resource for you and we thank you for being a part of sidux.
Sve verzije paketa koje se mogu instalirati (ovisi isto o vašoj sources.list datoteki) možete polistati sa:
$ apt-cache policy sidux-manual-en
sidux-manual-en:
Installed: (none)
Candidate:01.12.2007.06.03-1
Version table:
01.12.2007.06.03-1 0
500 http://sidux.com sid/main Packages
Searching for a package with kio-apt
Using kio-slave, Konqueror provides a non-dangerous way of using a GUI to search for packages in APT. It is a GUI search engine for packages only, without any install or upgrade options.
This is a good alternative to other package managers search functions like in adept, aptitude, synaptic and kpackage, so you will not get tempted to dist-upgrade in X or install packages using tools that are not suited for Debian sid.
You can search the package database both within APT, and/or the Debian 'package search' on the Debian web site, It makes a good summary of the pages with the information from apt-cache policy and apt-cache show.
It provides:
- apt:/search? expression:searches the package databse for 'expression'. Like apt-cache search
- apt:/show? package: shows detailed information about 'package'. Like apt-cache show. It prints the policy too.
- apt:/policy? package: shows the policy for 'package'. Like apt-cache policy.
- apt:/list? package: lists the files in 'package'.


Installation
sux apt-get update && apt-get install kio-apt
Then konqueror and type in:
apt:/
and hit the enter key. See description for all possible options which include searching with a compact form or an extended form..
A complete description of the APT-System can be found at APT-HOWTO

Traži Online Offline