如果首选来源的版本较旧,我试图阻止从多个存储库获得的软件包,从特定来源进行更新。
以以下apt-cache策略示例为例:
mariadb-client:
Installed: 10.1.37-0+deb9u1
Candidate: 10.1.38-0+deb9u1
Version table:
10.1.37-0+deb9u1 990
990 http://security.debian.org stretch/updates/main amd64 Packages
10.1.38-0+deb9u1 10
10 http://my.mirrorserver.com/debian stretch/main amd64 Packages
基于上述内容,如果my.mirrorserver.com具有较新的版本,但我的首选版本是源自“ security.debian.org”的版本,那么如何调整apt首选项/ apt源文件以确保即使有来自my.mirrorserver.com的较新版本,该候选人仍来自security.debian.org,仍为10.1.37-0 + deb9u1,而未从my.mirrorserver.com安装10.1.38-0 + deb9u1吗?
我尝试过的事情:
尝试根据首选项文件中的原点将引脚定为负:
Package: *mariadb*
Pin: origin my.mirrorserver.com
Pin-Priority: -1 or a value < 100
Package: *mariadb*
Pin: origin security.debian.org
Pin-Priority: 990
使用aptitude图形界面,我选择了“ Package> Forbid Version”-没什么区别。
预期结果与当前结果:
Expected result pseudo output:
mariadb-client:
Installed: 10.1.37-0+deb9u1
Candidate: 10.1.37-0+deb9u1
Version table:
10.1.37-0+deb9u1 990
990 http://security.debian.org stretch/updates/main amd64 Packages
10.1.38-0+deb9u1 10
10 http://my.mirrorserver.com/debian stretch/main amd64 Packages
当前结果:
mariadb-client:
Installed: 10.1.38-0+deb9u1
Candidate: 10.1.38-0+deb9u1
Version table:
10.1.37-0+deb9u1 990
990 http://security.debian.org stretch/updates/main amd64 Packages
10.1.38-0+deb9u1 10
10 http://my.mirrorserver.com/debian stretch/main amd64 Packages```
How do I go about achieving such results / is it possible?