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
Expected outcome of running the command.

Check the CPU architecture of your server:

cat /proc/cpuinfo | grep vendor_id
Expected outcome of running the command.

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

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.

Expected outcome of running the command.
Expected result of the command running successfully.
sudo apt autoremove

Press Y when prompted.

Press the Enter key to confirm.

Expected outcome of running the command.
Expected result of running the command successfully.

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.

Expected result of executing the steps.

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.

Parts of Mono is still installed and we need to remove them.

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.

Expected outcome of running the command.
Expected result of running the command successfully.

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
Expected result of running the command successfully.

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
Expected result of running the two commands successfully.

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.

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

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.

Expected outcome of running the command.

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

Was this helpful?