[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#894170: apt: man apt_preferences: please document per-package pins



Package: apt
Version: 1.6~beta1
Severity: wishlist


Hi!
It would be nice if you could document, preferably by an example, how to
affect _all_ possible copies of a package, no matter where they come from.

This is useful in at least two cases:
* someone wants to prevent a package from being installed despite notorious
  Recommends (bash-completion, a *cough* certain init implementation, etc)
* someone wants a particular _architecture_ kept from being installed

I just had the latter case: x32 doesn't ship its kernel but uses one from
amd64 (similar to i386, except that there's no "native" kernel at all), and
the kernel package keeps insisting on replacing native irqbalance, apparmor
and so on with :amd64 versions.

Too bad, the documentation is lacking (or perhaps it's me not reading it
well enough), and I wasted quite a few minutes looking how to produce such a
rule.  Turns out, a missing Pin: line doesn't work, neither does "Pin: *".
You need to pick a dummy but valid field, and asterisk that.
Ie, "Pin: origin *" or "Pin: release *".

There's also no mention that you can limit the rule to a specific arch, but
fortunately my guess was correct.

Thus. please include one of the following examples:

.----
Package: irqbalance:amd64
Pin: origin *
Pin-Priority: -1
`----
which blocks irqbalance:amd64 but not irqbalance:x32, or

.----
Package: libc6:amd64
Pin: origin *
Pin-Priority: -1
`----
which is a big hammer that blocks all regular foreign userland code,
allowing the kernel and static stuff.


Meow!
-- Package-specific info:

-- /etc/apt/preferences.d/no-amd64 --

Package: libc6:amd64
Pin: origin *
Pin-Priority: -1

-- /etc/apt/sources.list --

#deb http://apt.angband.pl:3142/ftp.debian-x32.org/debian/ jessie main contrib non-free
#deb-src http://apt.angband.pl:3142/ftp.pl.debian.org/debian/ jessie main contrib non-free

# jessie-updates, previously known as 'volatile'
#deb http://apt.angband.pl:3142/ftp.debian-x32.org/debian/ jessie-updates main contrib non-free
#deb-src http://apt.angband.pl:3142/ftp.debian-x32.org/debian/ jessie-updates main contrib non-free

# jessie-backports, previously on backports.debian.org
#deb http://apt.angband.pl:3142/ftp.debian-x32.org/debian/ jessie-backports main contrib non-free
#deb-src http://apt.angband.pl:3142/ftp.debian-x32.org/debian/ jessie-backports main contrib non-free

deb http://angband.pl/debian sid main

deb [arch=amd64] http://apt.angband.pl:3142/debian unstable main contrib non-free
deb [arch=x32] http://apt.angband.pl:3142/ftp.debian-ports.org/debian unstable main
deb [arch=x32] http://apt.angband.pl:3142/ftp.debian-ports.org/debian unreleased main
deb-src http://apt.angband.pl:3142/debian unstable main contrib non-free

-- (no /etc/apt/sources.list.d/* present) --


-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.15.0-1-amd64 (SMP w/6 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages apt depends on:
ii  adduser                 3.117
ii  debian-archive-keyring  2017.7
ii  gpgv                    2.2.5-1
ii  libapt-pkg5.0           1.6~beta1
ii  libc6                   2.27-2
ii  libgcc1                 1:8-20180321-1
ii  libgnutls30             3.5.18-1
ii  libseccomp2             2.3.1-2.1
ii  libstdc++6              8-20180321-1

Versions of packages apt recommends:
ii  ca-certificates  20170717

Versions of packages apt suggests:
pn  apt-doc         <none>
ii  aptitude        0.8.10-6
ii  dpkg-dev        1.19.0.5
ii  gnupg           2.2.5-1
ii  powermgmt-base  1.33

-- no debconf information


Reply to: