Mainos / Advertisement:


From Taisto
Jump to navigation Jump to search
This page is a translated version of the page APT and the translation is 100% complete.

Other languages:
English • ‎suomi

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

APT (Advanced Packaging Tool)


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


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 wheezy main contrib
deb-src wheezy main contrib

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

 aptitude update

Updating packages:

 aptitude upgrade

Example sources.list

deb wheezy main
deb-src wheezy main
deb wheezy-updates main
deb-src wheezy-updates main
deb wheezy/updates main
deb-src 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.


[email protected]:/# 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)

[email protected]:/# 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"


Mainos / Advertisement: