我的 Debian 系统设置为默认安装不稳定的软件包
$ cat /etc/apt/apt.conf.d/99defaultrelease
APT::Default-Release "unstable";
但是,我想automake
从stable
1.15 版中提取
$ apt-cache policy automake
automake:
Installed: (none)
Candidate: 1:1.16.1-4
Version table:
1:1.16.1-4 990
500 http://deb.debian.org/debian testing/main amd64 Packages
500 http://deb.debian.org/debian testing/main i386 Packages
990 http://deb.debian.org/debian unstable/main amd64 Packages
990 http://deb.debian.org/debian unstable/main i386 Packages
990 http://deb.debian.org/debian sid/main amd64 Packages
990 http://deb.debian.org/debian sid/main i386 Packages
1:1.15-6 500
500 http://deb.debian.org/debian stable/main amd64 Packages
500 http://deb.debian.org/debian stable/main i386 Packages
但是每当我告诉它 installautomake/stable
或automake
with 时-t stable
,都会apt
忽略该部分。
$ apt-get install automake -t stable --dry-run
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
autoconf autotools-dev
Suggested packages:
autoconf-archive gnu-standards autoconf-doc libtool
The following NEW packages will be installed:
autoconf automake autotools-dev
0 upgraded, 3 newly installed, 0 to remove and 125 not upgraded.
Inst autoconf (2.69-11 Debian:testing, Debian:unstable [all])
Inst autotools-dev (20180224.1 Debian:testing, Debian:unstable [all])
Inst automake (1:1.16.1-4 Debian:testing, Debian:unstable [all])
Conf autoconf (2.69-11 Debian:testing, Debian:unstable [all])
Conf autotools-dev (20180224.1 Debian:testing, Debian:unstable [all])
Conf automake (1:1.16.1-4 Debian:testing, Debian:unstable [all])
我可以像这样指定包版本:
apt-get install automake=1:1.15-6
这应该可以解决我的问题,尽管依赖项(autoconf、autotools-dev 等)仍然会从不稳定的环境中安装,这有点令人担忧。
无论如何,为什么在这种情况下忽略给定的目标?
另外 - 这不是一个问题 - 如果这种行为是“设计使然”,我认为如果apt
可以打印一些信息通知会非常好。
编辑
这是apt -t stable policy automake
(注意:安装后automake
)的输出
$ apt -t stable policy automake
automake:
Installed: 1:1.16.1-4
Candidate: 1:1.16.1-4
Version table:
*** 1:1.16.1-4 1001
500 http://deb.debian.org/debian testing/main amd64 Packages
500 http://deb.debian.org/debian testing/main i386 Packages
1001 http://deb.debian.org/debian unstable/main amd64 Packages
1001 http://deb.debian.org/debian unstable/main i386 Packages
1001 http://deb.debian.org/debian sid/main amd64 Packages
1001 http://deb.debian.org/debian sid/main i386 Packages
100 /var/lib/dpkg/status
1:1.15-6 990
990 http://deb.debian.org/debian stable/main amd64 Packages
990 http://deb.debian.org/debian stable/main i386 Packages
由于这可能是优先级的问题,因此这也可能是相关的:
$ cat /etc/apt/preferences
Package: *
Pin: release a=unstable
Pin-Priority: 1001
您看到的行为来自您定义的优先级。设置默认发布,使用
Default-Release
or-t
,对应版本设置优先级为 990;你对不稳定的 1001 的优先级总是超过它。详情请参阅
man apt_preferences
。