11

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.

2 Answers 2

20

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/

9
  • 1
    I thought it was going to work there, but I keep getting... W: Conflicting distribution: download.mono-project.com wheezy/snapshots/4.0.5.1 InRelease (expected wheezy/snapshots but got wheezy) Commented Nov 17, 2015 at 23:08
  • 2
    'deb download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1 main' needs to be 'deb download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1/. main' to make it work. Adding '/.' makes it work for whatever reason. Commented Nov 18, 2015 at 7:57
  • 1
    Related bug: bugzilla.xamarin.com/show_bug.cgi?id=24902, sometimes the adding of /. doesn't seem to work so you should try wheezy/snapshots 4.0.5.1/main. Commented Apr 18, 2016 at 14:50
  • Thanks for the info/bug link Commented Apr 18, 2016 at 14:51
  • They made that URL as hard as possible to get right! It's not even browsable!
    – Dagrooms
    Commented Sep 27, 2017 at 20:41
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.