I asked IT to install Mono on CentOS using the following commands:
$yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
$cd /usr/local/src
$wget http://download.mono-project.com/sources/mono/mono-3.2.5.tar.bz2
$tar jxf mono-3.2.5.tar.bz2
$cd mono-3.2.5
$./configure --prefix=/opt/mono
$make && make install
However, when I run mono myapp.exe
I get
-bash: mono: command not found
I know nothing about Linux - I feel like I'm in Japan. Assuming Linux has a path variable or something like it, maybe mono isn't in the path?
I can't even find an executable called mono
in /usr/local/src
, just a mono
folder. Mind you I can't work out how to even search for a file so I might not be looking properly.
How can I tell whether its installed correctly? Maybe its just not available to the non-admin account I use?
I'm lost. Help!
To check the version of Mono that is installed, please open Terminal and type "mono -V" (note capital 'V') and the result will be displayed. Mono versions.
Mono is Microsoft's . NET compatible and based on EMCS. Mono can be installed on Linux Mint 20 from the synaptic package manager, command line, and mono official repositories.
The installer will deposit all the necessary files in C:\Program Files\Mono-1.0, but you can override that by entering a different folder. Batch files that wrap each of the Mono executables will be installed in C:\Program Files\Mono-1.0\bin, so must add that to your PATH environment variable.
If mono
is properly installed, you should not get a message like -bash: mono: command not found
. If something is installed then it most typically is in the $PATH
.
On my system the executable is located on /usr/bin/mono
(as most things are) but things may be different on a RPM-based system.
Your ./configure
, however, got the prefix /opt/mono
, so probably your executable also is located under that special path. (And thus mono
isn't properly installed.) Why did you install it there? Anyway. If this is the fact, then you can execute it using sth like
/opt/mono/bin/mono foo.exe
to find the executable below your prefix path you could use
find /opt/mono -name mono
to see all directory entries which are named exactly mono
. One of those should be your executable.
If your programm is properly installed you will usually find it's executable using "which"
which programm
like:
which firefox
/usr/bin/firefox
There are many guides and tutorials out there that recommend installing in /opt/mono
in order to not conflict with the mono supplied by official distribution packages (which would be installed in /usr
).
However what most of those guides miss is that /opt/mono
is a non-standard prefix that will not be taken in account by the system when trying to find the executables (the system looks at the $PATH environment variable).
There are 2 possible solutions to this:
/opt/mono
use /usr/local
(which is actually what ./configure
or ./autogen.sh
uses by default if you don't supply any prefix!). This prefix is normally included in the $PATH environment variable of most distributions.The reason that many internet tutorials recommend /opt/mono
instead of /usr/local
is actually because most of them are based on the wiki page (referenced above) that explains how to set up a Mono Parallel Environment, but they of course don't include the other steps to properly set up such an environment (they just borrowed the bit about how to call configure).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With