通过 forbid-version 选项,您可以使用 aptitude 进行此操作。
在用户界面中选择软件包的版本并按下 'F' 键。
或者,您也可以通过命令行界面进行操作,请参阅 manpage。
forbid-version
Forbid a package from being upgraded to a particular version, while allowing automatic upgrades to future versions. This is useful for example to avoid a known broken version of a package,
without having to set and clear manual holds.
By default, aptitude will select the forbidden version to be the one which the package would normally be upgraded (the candidate version). This may be overridden by appending „=<version>“ to the
package name: for instance, „aptitude forbid-version vim=1.2.3.broken-4“.
To revert the action, „aptitude install <package>“ will remove the ban. To remove the forbidden version without installing the candidate version, the current version should be appended: „install
<package>=<version>“.
请注意:这个禁用版本只能通过适应性来尊重。如果运行apt-get或其他软件包管理器,将会升级该软件包。
echo "软件包名称 安装" | sudo dpkg --set-selections
或者使用aptitude:aptitude unhold 软件包名称
。 - Paul Tobias