LoginSignup
22
21

More than 5 years have passed since last update.

新しいバージョンのMonoをインストールする方法

Last updated at Posted at 2014-10-16

Ubuntuでのmonoバージョン

Ubuntuの公式パッケージサーバーにホストされているmonoのバージョンは、ちょっと古いバージョンで止まっています。
C#好きの私としては悲しいですが、Linuxの世界では、C#はあまり人気が無いんでしょうね。
この情報は、Raspberry Piで、HttpClientクラスを使うC#コードを動かしたくて調べた情報です。
マイクロソフト嫌いな方もLinuxにC#をインストールして試して貰える切っ掛けになったら幸いです。

外部パッケージリポジトリを利用する

directhexさんが公開しているパッケージリポジトリを更新サーバーに追加します。
Monoxide experimental Mono packages PPA
directhexさんのビルドしたパッケージが、どの程度信用できるかは分かりませんが、Raspberry Piなど非力なマシンで、monoをコンパイルするのは、かなり時間が掛かるので、手っ取り早く新しいバージョンのmonoを試したい時には重宝します。

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:directhex/monoxide
$ sudo apt-get update

ソースコードからインストールする

http://www.mono-project.com/docs/compiling-mono/linux/
公式ページに公開されている方法をコマンドで打っていけば、インストールできます。
gitから最新ソースコードを取得する方法も紹介されていますが、コンパイルエラーが発生することもあるようなので、リリースされた最新版をビルドする方が無難です。

$ sudo mkdir /opt/mono/
$ sudo chown -R `whoami` /opt/mono/
$ sudo apt-get install git autoconf libtool automake build-essential mono-devel gettext
$ wget http://download.mono-project.com/sources/mono/mono-3.10.0.tar.bz2
$ tar xvf mono-3.10.0.tar.bz2
$ cd mono-3.10.0
$ ./configure --prefix=/opt/mono/
$ make
$ sudo make install
$ PATH=/opt/mono/bin:$PATH

バージョンごとにインストール場所を変える

$ tar xvf mono-3.12.0.tar.bz2
$ cd mono-3.12.0
$ ./configure --prefix=/opt/mono/3.12
$ make
$ sudo make install
$ PATH=/opt/mono/3.12/bin:$PATH
22
21
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
21