我们最近从 10.04 升级到了 14.04。
我们有一些被搁置的软件包,我们会不时地升级它们。看来在 14.04 上,当您安装或升级软件包时,它会删除对该软件包的搁置。
$ dpkg --get-selections libmysqlclient18
libmysqlclient18:amd64 install
# Hold the package
$ echo 'libmysqlclient18:amd64 hold' | sudo dpkg --set-selections
# Check that worked
$ dpkg --get-selections libmysqlclient18
libmysqlclient18:amd64 hold
# Install a new version of the package
$ sudo apt-get install libmysqlclient18
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mysql-common
The following held packages will be changed:
libmysqlclient18
The following packages will be upgraded:
libmysqlclient18 mysql-common
2 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
Need to get 610 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-common all 5.5.44-0ubuntu0.14.04.1 [13.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libmysqlclient18 amd64 5.5.44-0ubuntu0.14.04.1 [596 kB]
Fetched 610 kB in 1s (339 kB/s)
Reading changelogs... Done
apt-listchanges: Mailing root: apt-listchanges: changelogs for <host>
(Reading database ... 490677 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.5.44-0ubuntu0.14.04.1_all.deb ...
Unpacking mysql-common (5.5.44-0ubuntu0.14.04.1) over (5.5.43-0ubuntu0.14.04.1) ...
Preparing to unpack .../libmysqlclient18_5.5.44-0ubuntu0.14.04.1_amd64.deb ...
Unpacking libmysqlclient18:amd64 (5.5.44-0ubuntu0.14.04.1) over (5.5.43-0ubuntu0.14.04.1) ...
Setting up mysql-common (5.5.44-0ubuntu0.14.04.1) ...
Setting up libmysqlclient18:amd64 (5.5.44-0ubuntu0.14.04.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
安装已解除锁定!
$ dpkg --get-selections libmysqlclient18
libmysqlclient18:amd64 install
这种情况发生在没有 postinst/prerm 脚本的软件包上,因此问题似乎出在 apt 上,而不是软件包本身。10.04 中没有发生这种情况。
有人能建议一种可以阻止 apt 这样做的解决方法吗?
答案1
这是一个 dpkg 更改,而不是 apt 更改:
# dpkg --get-selections | grep hold
google-chrome-stable hold
# dpkg -i google-chrome-stable_44.0.2403.125-1_amd64.deb
(Reading database ... 318187 files and directories currently installed.)
...
# dpkg --get-selections | grep hold
#
在执行了一些 git bisect 之后,这个更改被引入到https://anonscm.debian.org/cgit/dpkg/dpkg.git/commit/?id=fb8997a460a0ef2909199b4603604a4e855003e0作为...的一部分https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162541