Buford T. Justice
Buford T. Justice

Reputation: 213

Install Older Version of Mono

Today my Ubuntu updated Mono to 4.2.1.102. It will not allow a certain program I absolutely need to run. How can I down-grade it to 4.0.5.1? I have tried...

sudo apt-get install mono-complete=4.0.5.1

That doesn't work.

Upvotes: 11

Views: 25294

Answers (2)

user10762823
user10762823

Reputation: 11

If, like me, you followed the official guide: https://www.mono-project.com/download/stable/ then you would have added an apt key and created /etc/apt/sources.list.d/mono-official-stable.list You can keep the key, but remove the file above using sudo rm -r /etc/apt/sources.list.d/mono-official-stable.list Then make sure you follow the best answer above by editing the mono-xamarin.list file for the version you want and remove the version of mono you have. Then apt update, then install mono-complete. An easy way to know you are correctly downloading and compiling a different version is that apt will prompt you asking if you want to download the files, and the size will be different.

Hope this helps someone, this last step made it work for me. My system is Ubuntu 18.04.

Upvotes: 1

SushiHangover
SushiHangover

Reputation: 74209

Edit your /etc/apt/sources.list.d/mono-xamarin.list and change:

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

to:

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

That will pin it to version 4.0.5.1.

FYI: Make sure that you do not have any alpha/beta repos for mono in any of your /etc/apt/sources/list.d/xxxxx.list files.

Basic Steps to Downgrade:

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.

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

Ref: Versions available:

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

Upvotes: 20

Related Questions