debian-apt.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1882 c9390070dc36
child 1905 fba288d59662
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
.. -*- coding: utf-8; -*-
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1321
diff changeset
     2
.. include:: HEADER.rst
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
======
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Apt.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
======
1346
a2fbf50a43f4 Fix: Has no 'contents::' directive.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
     7
.. contents::
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
Conf files.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
===========
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
1460
59cb3aaa2fab apt_preferences(5).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1459
diff changeset
    12
See man sources.list(5), apt.conf(5), apt_preferences(5).
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
1459
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    14
``/etc/apt/sources.list``::
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    15
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    16
  deb http://ftp.debian.org.ua/debian/ stable main contrib non-free
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    17
  deb http://ftp2.debian.org.ua/debian/ testing main contrib non-free
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    18
  deb http://ftp2.debian.org.ua/debian/ unstable main contrib non-free
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    19
  deb http://ftp.uk.debian.org/debian/ experimental main contrib non-free
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    20
  deb http://www.deb-multimedia.org testing main non-free
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    21
1860
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    22
Package priority.
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    23
=================
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    24
1459
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    25
``/etc/apt/preferences``::
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    26
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    27
  Package: *
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    28
  Pin: release a=stable
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    29
  Pin-Priority: 800
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    30
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    31
  Package: *
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    32
  Pin: release a=testing
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    33
  Pin-Priority: 900
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    34
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    35
  Package: *
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    36
  Pin: release a=unstable
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    37
  Pin-Priority: 700
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    38
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    39
  Package: *
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    40
  Pin: release a=experimental
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    41
  Pin-Priority: 600
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
1860
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    43
Example that prevent installing ``*systemd*`` packages (priority strictly below
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    44
``0`` forbid package to be installed)::
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    45
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    46
  Package: systemd
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    47
  Pin: origin ""
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    48
  Pin-Priority: -1
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    49
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    50
  Package: *systemd*
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    51
  Pin: origin ""
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    52
  Pin-Priority: -1
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    53
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    54
Example that avoid installing packages from different distribution (priority
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    55
strictly below ``100`` cause a version to be installed only if there is no
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    56
installed version of the package), you should keep main distribution priority
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    57
above foreign distro priority::
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    58
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    59
  Package: *
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    60
  Pin: release a=testing
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    61
  Pin-Priority: 990
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    62
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    63
  Package: *
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    64
  Pin: release o=Kali
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    65
  Pin-Priority: 50
7fe8efa766f4 Package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1859
diff changeset
    66
1861
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    67
To discover package priority::
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    68
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    69
  bash# apt-cache madison emacs24
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    70
     emacs24 |   24.5+1-3 | http://ftp.us.debian.org/debian/ testing/main amd64 Packages
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    71
     emacs24 |   24.4+1-5 | http://http.kali.org/kali/ kali-current/main amd64 Packages
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    72
     emacs24 |   24.5+1-3 | http://ftp.us.debian.org/debian/ testing/main Sources
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    73
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    74
  bash# apt-cache policy emacs24
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    75
  emacs24:
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    76
    Installed: 24.5+1-3
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    77
    Candidate: 24.5+1-3
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    78
    Version table:
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    79
   *** 24.5+1-3 0
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    80
          990 http://ftp.us.debian.org/debian/ testing/main amd64 Packages
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    81
          100 /var/lib/dpkg/status
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    82
       24.4+1-5 0
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    83
           50 http://http.kali.org/kali/ kali-current/main amd64 Packages
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    84
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    85
  bash# aptitude versions emacs24
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    86
  Package emacs24:
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    87
  p   24.4+1-5                                      kali-current              50
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    88
  i   24.5+1-3                                      testing                   990
c28dba308db9 Discover package priority.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1860
diff changeset
    89
1738
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
    90
Debian releases.
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
    91
================
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
    92
1739
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    93
Workflow::
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    94
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    95
  experimental → unstable (sid) → testing → stable
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    96
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    97
Which package from witch release::
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    98
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
    99
  $ aptitude search ~S~i~Astable
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
   100
  $ aptitude search ~S~i~Atesting
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
   101
  $ aptitude search ~S~i~Aunstable
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
   102
  $ aptitude search ~S~i~Aexperimental
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
   103
1738
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
   104
 * https://wiki.debian.org/DebianReleases
1739
733104e6ad9a Which package from witch release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1738
diff changeset
   105
 * https://wiki.debian.org/DebianOldStable
1738
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
   106
 * https://wiki.debian.org/DebianStable
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
   107
 * https://wiki.debian.org/DebianTesting
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
   108
 * https://wiki.debian.org/DebianUnstable
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
   109
 * https://wiki.debian.org/DebianExperimental
eb9175d6d110 Debian releases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1732
diff changeset
   110
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
Setup backport.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   112
===============
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   113
1459
3000c0f32807 /etc/apt/preferences
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
   114
Main backports archive located at http://www.backports.org.
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
To get packeges gpg sign key::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   117
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
  $ su
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
  ...
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
  $ wget -O - http://backports.org/debian/archive.key | apt-key add -
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
  $ ^D
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
Write where packeges places::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
  $ cat /etc/apt/sources.list
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   126
  deb http://www.backports.org/debian/ etch-backports main contrib non-free
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
1859
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   128
Importing package signing key.
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   129
==============================
1859
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   130
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   131
Usualy you can safely update keyring via ``debian-keyring`` package because it
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   132
is signed by prevoius keyring::
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   133
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   134
  $ sudo apt-get install debian-keyring
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   135
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   136
Defferent 3rd party provide keys for download. If you trust key (or get it in a
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   137
trusted way) it is easy to import it::
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   138
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   139
  $ sudo apt-key add $FILE.pgp
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   140
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   141
Another way to resolve warning::
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
  $ sudo apt-get update
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
  ...
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   145
  W: There is no public key available for the following key IDs:
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   146
  9AA38DCD55BE302B
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   147
  W: GPG error: http://http.us.debian.org etch Release: The following signatures
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   148
  couldn't be verified because the public key is not available: NO_PUBKEY
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   149
  9AA38DCD55BE302B
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   150
  ...
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   151
1859
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   152
is to use key servers directly::
048f61a3be91 Importing package signing key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1739
diff changeset
   153
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   154
  $ gpg --keyserver pgp.mit.edu --recv-key 9AA38DCD55BE302B \
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   155
  --keyserver-options http-proxy=http://user:pass@192.168.1.1:3128
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   156
  gpg: requesting key 55BE302B from hkp server pgp.mit.edu
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   157
  gpg: key 55BE302B: public key "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>" imported
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   158
  gpg: no ultimately trusted keys found
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   159
  gpg: Total number processed: 1
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   160
  gpg:               imported: 1  (RSA: 1)
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   161
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   162
  $ gpg --export 9AA38DCD55BE302B | sudo apt-key add -
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   163
  OK
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   164
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   165
Install build dependency for package.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   166
=====================================
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   167
::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   168
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   169
  $ apt-get install build-essential    # install dev LIBC and GCC C/C++
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   170
  $ sudo apt-get build-dep $package
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   171
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   172
If all you want is checking what packages are needed to build a given package::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   174
  $ apt-cache showsrc $package
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   175
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   176
or check 'Build-Depends' attribute in::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   177
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   178
  $ apt-cache show $package
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   179
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   180
Delete config file for removed packages.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   181
========================================
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   182
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   183
To get list of such packages use one of::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   184
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   185
  $ aptitude search ~c
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   186
  $ grep-status -n -sPackage -FStatus config-files
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   187
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   188
To remove them::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   189
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   190
  $ aptitude purge ~c
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   191
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   192
Delete obsolete packages.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   193
=========================
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   194
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   195
To get list of such packages use::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   196
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   197
  $ aptitude search ~o
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   198
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   199
To remove them::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   200
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   201
  $ aptitude purge ~o
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   202
1616
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   203
To remove packages that were automatically installed to satisfy dependencies and
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   204
are now no longer needed::
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   205
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   206
  $ sudo apt-get autoremove
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   207
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   208
Clean up packages cache.
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   209
========================
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   210
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   211
Remove everything from ``/var/cache/apt/archives/`` and
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   212
``/var/cache/apt/archives/partial/``::
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   213
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   214
  $ sudo apt-get clean
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   215
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   216
Removes package files that can no longer be downloaded, and are largely
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   217
useless::
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   218
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   219
  $ sudo apt-get autoclean
1559575ac211 Clean up packages cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1604
diff changeset
   220
1321
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   221
Check package files for modification.
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   222
=====================================
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   223
::
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   224
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   225
  $ sudo debsums --changed
baa1dd97c9e1 Delete config file for removed packages. Delete obsolete packages. Check
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   226
1604
797a3ba1f9b5 Search for packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1460
diff changeset
   227
Search for packages.
797a3ba1f9b5 Search for packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1460
diff changeset
   228
====================
797a3ba1f9b5 Search for packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1460
diff changeset
   229
::
797a3ba1f9b5 Search for packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1460
diff changeset
   230
797a3ba1f9b5 Search for packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1460
diff changeset
   231
  $ aptitude search '?tag(works-with::logfile)'
797a3ba1f9b5 Search for packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1460
diff changeset
   232
1715
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   233
Find nearest mirror.
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   234
====================
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   235
::
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   236
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   237
  $ sudo apt-get install netselect-apt
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   238
  $ netselect-apt stable
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   239
  $ netselect-apt testing
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   240
  $ netselect-apt unstable
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   241
  $ netselect-apt experimental
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   242
  $ netselect-apt sid
ec4088985c44 Find nearest mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1616
diff changeset
   243
1882
c9390070dc36 Newer approach for selecting mirror via DNS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1861
diff changeset
   244
Newer approach for selecting mirror is via DNS. Just use::
c9390070dc36 Newer approach for selecting mirror via DNS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1861
diff changeset
   245
c9390070dc36 Newer approach for selecting mirror via DNS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1861
diff changeset
   246
  http://httpredir.debian.org/
c9390070dc36 Newer approach for selecting mirror via DNS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1861
diff changeset
   247
1730
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   248
Show dependency graph.
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   249
======================
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   250
::
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   251
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   252
  $ apt-cache dotty $PKG | dot -Tsvg >$PKG.svg && see $PKG.svg
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   253
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   254
  $ sudo apt-get install debtree
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   255
  $ debtree $PKG | dot -Tsvg >$PKG.svg && see $PKG.svg
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   256
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   257
  $ sudo apt-get install apt-rdepends
1732
817615557a10 Fix usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1730
diff changeset
   258
  $ apt-rdepends $PKG
817615557a10 Fix usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1730
diff changeset
   259
  $ apt-rdepends -r $PKG
1730
fc588b9ae857 Show dependency graph.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1716
diff changeset
   260
  $ apt-rdepends -d $PKG | dot -Tsvg >$PKG.svg && see $PKG.svg
1732
817615557a10 Fix usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1730
diff changeset
   261
  $ apt-rdepends -d -r $PKG | dot -Tsvg >$PKG.svg && see $PKG.svg