安装旧版本的 Mono

Install Older Version of Mono

今天我的 Ubuntu 将 Mono 更新到 4.2.1.102。它不允许我绝对需要的某个程序运行。我怎样才能将它降级到 4.0.5.1?我试过了...

sudo apt-get install mono-complete=4.0.5.1

那不行。

编辑您的 /etc/apt/sources.list.d/mono-xamarin.list 并更改:

deb http://download.mono-project.com/repo/debian wheezy main

至:

deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1 main

这会将其固定到版本 4.0.5.1。

仅供参考:确保您的任何 /etc/apt/sources/list.d/xxxxx.list 文件中没有任何 alpha/beta 单声道存储库。

降级的基本步骤:

sudo apt-get remove mono-complete
# Edit your mono-xamarin.list and pin it to the version of your choice.
sudo apt-get update
sudo apt-get install mono-complete

Accessing older releases If for some reason you want to pin an older version of Mono rather than updating to the latest, you can modify the Debian repository to “wheezy/snapshots/X.XX.X” instead of “wheezy”. For example, “wheezy/snapshots/3.10.0” will lock you to that version.

These snapshots will cease receiving updates as soon as the next major Mono version gets uploaded - for example, as soon as Mono 3.12 gets uploaded, 3.10 will never receive updates.

On RPM distributions, force the package version in your package manager - all older versions are published in the YUM metadata and should be available.

参考:http://www.mono-project.com/docs/getting-started/install/linux/#accessing-older-releases

参考:可用版本:

http://download.mono-project.com/repo/debian/pool/main/m/mono/

如果您像我一样遵循官方指南:https://www.mono-project.com/download/stable/ 那么您将添加一个 apt 密钥并创建 /etc/apt/sources.list.d/mono-official-stable.list 您可以保留密钥,但使用 sudo rm -r /etc/apt/sources.list.d/mono-official-stable.list 删除上面的文件 然后确保您通过编辑 mono-xamarin.list 文件以获得您想要的版本并删除您拥有的 mono 版本,从而遵循上面的最佳答案。 然后apt update,然后安装mono-complete。知道你是否正确下载和编译不同版本的一个简单方法是 apt 会提示你是否要下载文件,并且大小会有所不同。

希望这对某人有所帮助,最后一步使它对我有用。 我的系统是 Ubuntu 18.04.