Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Last active February 3, 2022 22:05
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yetanotherchris/42b429059e5fe1b3f7bb4169f5706c00 to your computer and use it in GitHub Desktop.
Save yetanotherchris/42b429059e5fe1b3f7bb4169f5706c00 to your computer and use it in GitHub Desktop.
Install Mono on Amazon Linux (CentOS too)
sudo yum update -y
echo "======= INSTALLING RPM FOR MONO ======="
sudo mkdir -p /tmp/mono_dependencies
cd /tmp/mono_dependencies
sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-11.fc33.x86_64.rpm
sudo yum install -y libpng15-1.5.30-11.fc33.x86_64.rpm
echo "======= INSTALLING MONO ============"
sudo yum install -y yum-utils
sudo rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
sudo yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
sudo yum clean all
sudo yum makecache
sudo yum install -y mono-complete
sudo rm -rf /tmp/mono_deps
echo "======= TESTING MONO ============"
cd ~
echo "using System; public class HelloWorld { static public void Main () { Console.WriteLine (\"ヅ Hello from Mono (hello.exe). Installation complete! ヅ\"); } }" > hello.cs
mcs hello.cs
mono hello.exe
@yetanotherchris
Copy link
Author

Use this for creating an Octopus deploy SSH tentacle on Amazon Linux

@amrfaisal
Copy link

Update to use the latest libpng15 rpm:
wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.28-2.fc26.x86_64.rpm
yum install -y libpng15-1.5.28-2.fc26.x86_64.rpm

@IvanIFChen
Copy link

another latest version update:

sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-3.fc28.x86_64.rpm 
sudo yum install -y libpng15-1.5.30-3.fc28.x86_64.rpm 

@VidYen
Copy link

VidYen commented Aug 20, 2018

August update:
sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-6.fc29.x86_64.rpm

@dsedleckas
Copy link

Februrary update: sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-7.fc30.x86_64.rpm

@bhomer7
Copy link

bhomer7 commented Nov 10, 2020

sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-11.fc33.x86_64.rpm

@yetanotherchris
Copy link
Author

I've updated the Gist to the above rpm

@tyronx
Copy link

tyronx commented Feb 23, 2021

On Amazon Linux 2 I was able to install mono simply with sudo amazon-linux-extras install mono
(after I cleaned up the mess trying to install mono using centos8 commands from mono-project.com)

@a-bigelow
Copy link

a-bigelow commented Jul 29, 2021

On Amazon Linux 2 I was able to install mono simply with sudo amazon-linux-extras install mono
(after I cleaned up the mess trying to install mono using centos8 commands from mono-project.com)

Thanks for this. Pays to scroll!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment