{"id":5227,"date":"2021-03-22T14:17:12","date_gmt":"2021-03-22T14:17:12","guid":{"rendered":"https:\/\/linuxways.net\/?p=5227"},"modified":"2021-03-22T14:17:12","modified_gmt":"2021-03-22T14:17:12","slug":"how-to-install-mono-on-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-install-mono-on-centos-8\/","title":{"rendered":"How to Install Mono on CentOS 8"},"content":{"rendered":"<p>Mono is a cross-platform framework that is used for developing and operating various applications based on some additional specified standards. It supports .net frameworks and standard API as well as .net desktop APIs. it is an open-source and free implementation of the .net framework.<\/p>\n<p>We will discuss in this article, how to install Mono and how to use this platform on CentOs 8.<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<p>You should have sudo command or root privileges.<\/p>\n<p>Launch the terminal from the left sidebar of your desktop Activities section and then implement the following steps:<\/p>\n<h2><strong>Installing of Mono on CentOS 8<\/strong><\/h2>\n<p>This method is recommended and the very easiest solution to install Mono from its official repository on CentOS 8. It is a simple method and takes less time for installation. So, you need to implement the below-mentioned steps for Mono\u2019s installation on CentOS 8:<\/p>\n<h3><strong>Step 1: Import repository\u2019s GPG key<\/strong><\/h3>\n<p>Import the GPG key of Mono\u2019s repository on your CentOS 8 system by using the below-mentioned command:<\/p>\n<pre>$ sudo rpm --import '<a href=\"http:\/\/pool.sks-keyservers.net\/pks\/lookup?op=get&amp;search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef\">http:\/\/pool.sks-keyservers.net\/pks\/lookup?op=get&amp;search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef<\/a>'<\/pre>\n<p>None statement shows in output on the terminal, when you execute the above command as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1099\" height=\"113\" class=\"wp-image-5228\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-302.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-302.png 1099w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-302-300x31.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-302-1024x105.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-302-768x79.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<h3><strong>Step 2: Add Mono\u2019s Repository on CentOS 8<\/strong><\/h3>\n<p>Use the following command to include the Mono\u2019s repository to your CentOS 8 system:<\/p>\n<pre>$ sudo dnf config-manager --add-repo <a href=\"https:\/\/download.mono-project.com\/repo\/centos8-stable.repo\">https:\/\/download.mono-project.com\/repo\/centos8-stable.repo<\/a><\/pre>\n<p>After implementing the above-mentioned command, the following result appears on the terminal window:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1084\" height=\"127\" class=\"wp-image-5229\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-303.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-303.png 1084w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-303-300x35.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-303-1024x120.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-303-768x90.png 768w\" sizes=\"auto, (max-width: 1084px) 100vw, 1084px\" \/><\/p>\n<h3><strong>Step 3: Mono Installation on CentOS 8<\/strong><\/h3>\n<p>Once the Mono\u2019s repository is included and enabled, the following command you can use to install the Mono on CentOS 8 system:<\/p>\n<pre>$ sudo dnf install mono-complete<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1198\" height=\"761\" class=\"wp-image-5230\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-304.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-304.png 1198w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-304-300x191.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-304-1024x650.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-304-768x488.png 768w\" sizes=\"auto, (max-width: 1198px) 100vw, 1198px\" \/><\/p>\n<p>Press \u2018y\u2019 to confirm the remaining installation process.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1205\" height=\"770\" class=\"wp-image-5231\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-305.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-305.png 1205w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-305-300x192.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-305-1024x654.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-305-768x491.png 768w\" sizes=\"auto, (max-width: 1205px) 100vw, 1205px\" \/><\/p>\n<p>In the above command, mono-complete is a meta-package through which you can install all required Mono\u2019s runtime development tools and libraries.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1195\" height=\"763\" class=\"wp-image-5232\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-306.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-306.png 1195w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-306-300x192.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-306-1024x654.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-306-768x490.png 768w\" sizes=\"auto, (max-width: 1195px) 100vw, 1195px\" \/><\/p>\n<h3><strong>Step 4: Check installed version<\/strong><\/h3>\n<p>To verify the Mono installation on CentOS 8 system, use the following command to display the installed version:<\/p>\n<pre>$ mono --version<\/pre>\n<p>The following output displays on the terminal with the installed version details:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1099\" height=\"410\" class=\"wp-image-5233\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-307.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-307.png 1099w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-307-300x112.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-307-1024x382.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-307-768x287.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<p>Now, you have been completed the Mono\u2019s installation on your CentOS 8 system. You can use and start Mono on your system.<\/p>\n<h2><strong>How to work with Mono?<\/strong><\/h2>\n<p>To test that all installations have been completed in the correct way. You need to build a test program to test the working of the Mono tool. For this purpose, create a testprogram.cs file by using any text editor. Here, we have created testprogram.cs file using the nano text editor.<\/p>\n<pre>$ sudo nano testprogram.cs<\/pre>\n<p>Now, paste the following source code in this file:<\/p>\n<pre>using System;\r\n\r\npublic class testprogram\r\n\r\n{\r\n\r\n\u00a0\u00a0\u00a0\u00a0public static void Main(string[] args)\r\n\r\n\u00a0\u00a0\u00a0\u00a0{\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Console.WriteLine (\"This is My Test Program!\");\r\n\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1104\" height=\"704\" class=\"wp-image-5234\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-308.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-308.png 1104w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-308-300x191.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-308-1024x653.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-308-768x490.png 768w\" sizes=\"auto, (max-width: 1104px) 100vw, 1104px\" \/><\/p>\n<p>Now, compile the testprogram.cs by using the \u2018csc\u2019 compiler as follows:<\/p>\n<pre>$ csc testprogram.cs<\/pre>\n<p>The above command creates an executable file \u2018testprogram.exe\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1071\" height=\"132\" class=\"wp-image-5235\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-309.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-309.png 1071w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-309-300x37.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-309-1024x126.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-309-768x95.png 768w\" sizes=\"auto, (max-width: 1071px) 100vw, 1071px\" \/><\/p>\n<p>Run the above test program by executing the following command:<\/p>\n<pre>$ mono testprogram.exe<\/pre>\n<p>The following output message shows on the terminal after executing the above command:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"99\" class=\"wp-image-5236\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-310.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-310.png 847w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-310-300x35.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-310-768x90.png 768w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/p>\n<h2><strong>Uninstall or remove Mono from CentOS 8<\/strong><\/h2>\n<p>Mono can be uninstalled from your system by running the below-given command:<\/p>\n<pre>$ sudo dnf remove mono<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1198\" height=\"769\" class=\"wp-image-5237\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-311.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-311.png 1198w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-311-300x193.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-311-1024x657.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-311-768x493.png 768w\" sizes=\"auto, (max-width: 1198px) 100vw, 1198px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Congratulations! Mono is installed successfully. We have studied in this article how to install the latest stable version from the Mono official repository. Moreover, we learned how to use Mono on CentOS 8 system. Please give me your suggestions through comments in case of any problem.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Mono is a cross-platform framework that is used for developing and operating various applications based on some additional specified standards. It supports .net frameworks and standard API as&hellip;<\/p>","protected":false},"author":1,"featured_media":5322,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,235],"class_list":["post-5227","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-mono"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/5227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=5227"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/5227\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/5322"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=5227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=5227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=5227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}