5
votes

i am unable to install monodevelop i am running it from terminal -- sudo apt-get install monodevelop but it comes out with error unable to locate package monodevelop how to install monodevelop on linux

Is there any method to install it from ubuntu software center

3
You should perform the first step to add the mono repo to your envrionment, then use the sudo apt-get install monodevelopEdgar
please advice whats the first step @EdgarDholu

3 Answers

6
votes
  1. sudo apt install apt-transport-https dirmngr

  2. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

  3. echo "deb https://download.mono-project.com/repo/ubuntu vs-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list

  4. sudo apt update

make sure you copy this command perfectly, in step 3 make sure you copy all command

2
votes

You should definitely install Monodevelop using Git repo. There are instructions right here

0
votes

After doing the above: Use the first answer solve the problem with monodevelop, then use this answer to install MCS.

incase you face any issue try running below command

sudo apt-get -f install

Now, install mcs utility which can compile your C# into exe file

sudo apt-get install mcs

create a c# file. For Example(This is how you name a c# file): "newfile.cs"

Sample code

 //This is a c# program that prints out "Hello World"
    using System;
    using System.IO;
    using System.Text;

    namespace IncludeHelp
    {
        class Test
        {
            static void Main(string[] args)
            {
                //This is line will print out "Hello World"
                Console.WriteLine("Hello World");

                //This let's us exit the porgram when you press enter 
                Console.ReadLine();
            }
        }
    }

Save the file as "newfile.cs"

Open terminal and type mcs newfile.cs

This will compile the file and turn it into a .exe file

Now type in the terminal the following mono newfile.cs

Good Luck!