Downgrading Mono

Downgrading Mono is not usually recommended but things sometimes go wrong and we understand that. Here's a simple guide (we hope!) to help you. If you need help, please do not hesitate to contact us through a ticket or ask our other users on Discord.

Verify Your System

Check what version of Ubuntu you are running by:

hostnamectl | grep Ubuntu

Check the CPU architecture of your server:

The commands you will copy in Reinstall an Older Mono Version will be different depending on the CPU architecture that you are running.

cat /proc/cpuinfo | grep vendor_id

Shutting Down the HTS platform

You can use either of these commands:

sudo killall mono

or

sudo kill $(ps ax | grep mono | fgrep -v grep | awk '{ print $1 }')

Steps to Downgrade Mono

Steps shown here are exclusively for Ubuntu and commands are to be run as root so that everything is properly deleted.

Remove the existing Mono installation (run these commands one after the other):

This command will remove all installed types of Mono even if you didn't install most of them in the first place. We just want to be sure to catch any and all of them rather than having to deal with some headaches down the line.

sudo apt remove mono-complete mono-vbnc ca-certificates-mono mono-runtime

Press Y when prompted.

Press the Enter key to confirm.

sudo apt autoremove

Press Y when prompted.

Press the Enter key to confirm.

Check /etc/apt/sources.list.d/ for any references to Mono. If they exist, remove them:

cd /etc/apt/sources.list.d/
sudo nano ./mono-official-stable.list

Delete ALL of the text that is shown in this file.

Once done, press Ctrl + X at the same time to save.

Press Y when prompted.

Press the Enter key to confirm.

Making sure that Mono is really gone

While not everyone needs to do this, it is best to run the first command once to be sure.

whereis mono

If your result is as shown, you'll need to follow the other steps in this section.

If the result is empty, move on to the Reinstall an Older Mono Version section.

Continuing with our removal of the straggling bits of Mono, we need to run this command:

sudo apt remove --purge --auto-remove mono-runtime

Press Y when prompted.

Press the Enter key to confirm.

This particular command will remove any other stragglers that might still hang around in our system.

dpkg --list | grep "mono" | cut -d " " -f 3 | xargs dpkg --purge

In order to make sure that the remaining Mono folders are removed, run this command.

sudo rm -rf /usr/lib/mono /etc/mono

Once that is done, run this command to make sure that Mono has 100% been purged from our system.

whereis mono

Reinstall an Older Mono Version

First, we will need to set a new line in our repository list file.

sudo nano /etc/apt/sources.list.d/mono-official-stable.list

In this file, we will paste only ONE of the three lines presented below. Please copy the one that matches the version of Ubuntu that you are running.

For users who are running on Intel based machines:

Ubuntu version 16:

deb https://download.mono-project.com/repo/ubuntu xenial/snapshots/5.14.0.177 main

Ubuntu version 18:

deb https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177 main

Ubuntu version 20 (lowest version of Mono you can downgrade to is 6.8):

deb https://download.mono-project.com/repo/ubuntu focal/snapshots/6.8 main

For users who are running on AMD based machines:

Ubuntu version 16:

deb [arch=amd64] https://download.mono-project.com/repo/ubuntu xenial/snapshots/5.14.0.177 main

Ubuntu version 18:

deb [arch=amd64] https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177 main

Ubuntu version 20 (lowest version of Mono you can downgrade to is 6.8):

deb [arch=amd64] https://download.mono-project.com/repo/ubuntu focal/snapshots/6.8 main

An example of a successful paste for Ubuntu version 18:

Press Ctrl + X at the same time to save.

Press Y when prompted.

Press the Enter key to confirm.

It's now time for what we've been waiting for, installing the older version of Mono! Run the below command in your terminal.

sudo apt install mono-complete mono-vbnc ca-certificates

Press Y when prompted.

Press the Enter key to confirm.

It is likely that the Mono version installed would be an older version than what we intended. To confirm this, run the following command.

mono -V

Now that we've confirmed that it's running an older version, we will need run the following two commands.

sudo apt update
sudo apt upgrade

Press Y when prompted.

Press the Enter key to confirm.

Run the following command one final time to confirm.

mono -V

Congratulations! You've downgraded your Mono version successfully.

Time to start up your HTS!

Last updated