Mainos / Advertisement:

APT

Kohteesta Taisto
Versio hetkellä 12. elokuuta 2015 kello 08.43 – tehnyt Frans (keskustelu | muokkaukset) (Ak: Uusi sivu: Example root@debian:/# aptitude search ssh ... i ssh - secure shell client and server (metapackage) ...)
Siirry navigaatioon Siirry hakuun
Muut kielet:
English • ‎suomi

You can read more about APT from wikipedia and the debian-wiki:

http://en.wikipedia.org/wiki/Advanced_Packaging_Tool

https://wiki.debian.org/Apt


APT (Advanced Packaging Tool)

Commands

apt-cache                     aptitude-create-state-bundle
apt-cdrom                     aptitude-curses
apt-config                    aptitude-run-state-bundle
apt-extracttemplates          apt-key
apt-ftparchive                apt-listchanges
apt-get                       apt-mark
aptitude                      apt-sortpkgs

/etc/apt/sources.list

A sources list used to defined where apt tries to get it's packages from.

 nano /etc/apt/sources.list

You can add a CD or DVD disc to the sources list (you have to mount the disk before this!) using the command:

 apt-cdrom add

After this open the sources.list file and change the darkened number to the number of your disc:

 deb cdrom:[Debian GNU/Linux 7.7.0 _Wheezy_ - Official amd64 DVD Binary-1 20141018-13:06]/ wheezy contrib main

You can enable internet sources by modifying the sources.list with the following lines:

deb http://ftp.fi.debian.org/debian/ wheezy main contrib
deb-src http://ftp.fi.debian.org/debian/ wheezy main contrib

The list of available packages can be updated with the command:

 aptitude update

Updating packages:

 aptitude upgrade

Example sources.list

deb http://http.debian.net/debian wheezy main
deb-src http://http.debian.net/debian wheezy main
deb http://http.debian.net/debian wheezy-updates main
deb-src http://http.debian.net/debian wheezy-updates main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

Searching for packets

You can search for installed and not installed packages using the command

 aptitude search searchword

The command returns you a list of packages that matched with the search word.


The line will begin with an "i" if the package is already installed.

After that comes the package name.

In the end there is a short description of the package.


Example

root@debian:/# aptitude search ssh
...
i   ssh                   - secure shell client and server (metapackage)
...

Pakettien asentaminen

Kun pakettilista on päivitetty onnistuneesti, voit asentaa paketteja komennolla

aptitude install paketinnimi

Useasti asennus kysy lupaa jatkaa, paina Y -kirjainta ja Enter jatkaaksesi

Esimerkki (proftpd)

root@debian:/# aptitude install proftpd
Note: selecting "proftpd-basic" instead of the
      virtual package "proftpd"
The following NEW packages will be installed:
  proftpd-basic proftpd-mod-vroot{a}
0 packages upgraded, 2 newly installed, 0 to remove and 46 not upgraded.
Need to get 2,573 kB of archives. After unpacking 4,356 kB will be used.
Do you want to continue? [Y/n/?]

Näytä asennetut paketit

Listaa kaikki asennetut paketit

 dpkg-query -l

Listaa tietty paketti jos on asennettu

 dpkg-query -l 'foo*'

Pakettien poistaminen

Poista asennettu paketti

 aptitude remove paketinnimi

Poista paketti ja konfiguraatiot

 aptitude purge paketinnimi

Lähteet

https://wiki.debian.org/ListInstalledPackages

Mainos / Advertisement: