There are a couple of ways to run C# applications on Linux operating systems. Before .NET Core, Mono used to be the only way for C# applications running on Linux machine. Each Linux distro has a different method to install Mono. In this post, we’ll walk through how to install Mono on Amazon Linux.

NOTE: Amazon Linux 2016.03.1 was used for this post.

According to the official document, we can follow the CentOS way. However, when we follow the instruction, we’ll get the following error like:

This can be sorted out by following the steps below:

First of all, take the root privilege by running the sudo su command. This MUST be returned after the installation to avoid further security breach. Taking the root permissions is not necessary. Instead, we MUST use sudo command every time we need to install something onto Amazon Linux.

Download the RPM package by executing the wget command, then install it. Once we complete installing the missing package, then follow the official document again to set up yum.

If necessary, the following commands can help refresh cache.

Now, we’re ready for Mono installation. Try the following command for it.

All downloaded files for missing dependencies are no longer necessary. So delete them.

Mono installation completed! Now exit from the root privilege.

Try a demo code to confirm if Mono has been properly installed. A sample demo code can be found from the official document. If everything is fine, we’ll be able to see the following result:

We’ve installed Mono onto Amazon Linux. As it’s a variation of CentOS/RHEL, it should be as easy as what the document says. However, some missing dependencies need to be installed beforehand. In the next post, we’re going to install .NET Core RC1 and RC2 onto Amazon Linux.

Category:
Application Development and Integration
Tags:
,

Join the conversation! 4 Comments

  1. […] needs to be sorted out before installing Mono. This post describes steps to install the missing dependencies on Amazon Linux. Once we install dependencies, […]

    Reply
  2. […] is a cross-posting of Installing Mono into Amazon Linux at […]

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: