I was trying to install mono for use by a package (CumulusMX weather station software) which relies on it.
I did "sudo apt-get install mono-complete". Everything started fine and I left it unattended. When I returned it had got as far as messages
Setting up mono-roslyn (5.16.0.179-0xamarin1+raspbian9b1) ...
Mono precompiling /usr/lib/mono/4.5/csc.exe for arm...
Mono precompiling /usr/lib/mono/4.5/vbc.exe for arm...
Mono precompiling /usr/lib/mono/4.5/VBCSCompiler.exe for arm...
Mono precompiling /usr/lib/mono/4.5/Microsoft.CodeAnalysis.CSharp.dll for arm...
When I checked, the Pi had completely locked: it did not respond to pressing the Start (Raspberry) button or to dragging the Terminal window. The green disk LED did not flash at all.
I powered off and rebooted. The Pi boots fine and every thing runs OK, except...
Any "sudo apt remove mono-complete" or "sudo apt-get install <package>" commands now give the message
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
And when I run sudo dpkg --configure -a it repeats the lines
Setting up mono-roslyn (5.16.0.179-0xamarin1+raspbian9b1) ...
Mono precompiling /usr/lib/mono/4.5/csc.exe for arm...
Mono precompiling /usr/lib/mono/4.5/vbc.exe for arm...
Mono precompiling /usr/lib/mono/4.5/VBCSCompiler.exe for arm...
Mono precompiling /usr/lib/mono/4.5/Microsoft.CodeAnalysis.CSharp.dll for arm...
and that terminal window sits there forever. (however the rest of the windowing system works fine).
How do it break out of this deadly embrace so I can remove mono-complete and try it again?
I notice that "top" lists process "llc" consuming almost 100% CPU.