やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

最新MONOインストール(Raspberry Pi 4)

 6.12.0.90。

手順

sudo apt install apt-transport-https dirmngr gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/debian stable-raspbianbuster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
time sudo apt -y install mono-devel mono-complete mono-vbnc mono-dbg referenceassemblies-pcl ca-certificates-mono  mono-xsp4 > /tmp/work/mono_install.log

 もしすでにインストール済みであり、更新したいだけなら以下。

sudo apt full-upgrade -y

 しばらくすると完了する。以下、バージョン確認。

$ mono -V
Mono JIT compiler version 6.12.0.90 (tarball Fri Sep  4 14:21:54 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  armel,vfp+hard
    Disabled:      none
    Misc:          softdebug 
    Interpreter:   yes
    LLVM:          yes(610)
    Suspend:       preemptive
    GC:            sgen (concurrent by default)
$ csc -version
3.6.0-4.20224.5 (ec77c100)
$ csc -help
...

失敗したら?

 私は更新時、こんなエラーが出た。

E: http://raspbian.raspberrypi.org/raspbian/pool/main/o/openjdk-11/openjdk-11-jre-headless_11.0.9+11-1~deb10u1_armhf.deb の取得に失敗しました raspbian.raspberrypi.org:80 (2a00:1098:0:80:1000:75:0:3) への接続を開始できません。 - connect (101: ネットワークに届きません) raspbian.raspberrypi.org:80 (93.93.128.193) へ接続できませんでした。接続がタイムアウトしました [IP: 93.93.128.193 80]

 原因は公式サーバ。たまにこういう症状になるらしい。詳しくは知らん。

 対処は以下。公式サーバをコメントアウトして保存する。

sudo vim /etc/apt/sources.list
deb http://ftp.jaist.ac.jp/raspbian/ buster main contrib non-free rpi
#deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

 そして以下を実行すると成功するはず。

sudo apt update -y
sudo apt full-upgrade -y

NuGet

 ダウンロードする。

wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
nuget.exe help

 パッケージ.dllを入手する。

mono nuget.exe install CommandLineParser
mono $(which nuget.exe) install CommandLineParser

所感

 更新で躓くと調べたりして大変。そういうのやめて。もう罠はたくさんだ。

対象環境

$ uname -a
Linux raspberrypi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux