Mainos / Advertisement:

APT

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
Tämä on käännetty versio sivusta APT, ja käännös on 100 % valmis.

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

Installing packages

Once your packages list has been successfully updated, you can install packages using the command

 aptitude install packagename

In most cases the installation will prompt you for permission to continue, press "Y" and then "Enter" to continue.

Example (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/?]

Show installed packages

List all installed packages

 dpkg-query -l

List a certain package if it's installed

 dpkg-query -l 'foo*'

Removing packages

Remove installed package

 aptitude remove "packagename"

Remove package and configurations

 aptitude purge "packagename"

Sources

https://wiki.debian.org/ListInstalledPackages

Mainos / Advertisement: