Question:
How can I downgrade a package to an older version via apt-get?
Other tools are also acceptable but apt-get is preferred.
Answer:
If you have the version number, or the target release, apt-get supports choosing a particular version or target release. More details can be found on manual page of apt-get. It can also be accessed from terminal by typing man apt-get
sudo apt-get install <package-name>=<package-version-number> OR
sudo apt-get -t=<target release> install <package-name>
is the command to be run. This can be used to down-grade a package to a specific version.
It has been helpfully pointed out in the comments that
apt-cache showpkg <package-name>lists all available versions. (h/t Sparhawk)apt-mark hold <package-name>"holds" the package at the current version, preventing automatic upgrades. (h/t Luís de Sousa )使用这个命令可以将指定的包的版本
hold住,这样在更新的时候就会忽略掉这个包。apt-mark unhold xxx- 1
将
hold替换为unhold就可以取消对这个包版本的锁定了。
source: https://askubuntu.com/questions/138284/how-to-downgrade-a-package-via-apt-get
本文介绍了如何通过apt工具降级已安装的软件包到旧版本。通过apt-get的选项可以选择特定版本或目标发行版,或者使用apt-cache来查看所有可用版本。此外,使用'hold'可以锁定软件包的当前版本,防止自动升级。

1万+

被折叠的 条评论
为什么被折叠?



