martinu
Posts: 15
Joined: Mon Oct 08, 2018 1:09 pm

Installation of mono-complete package caused R Pi to freeze, and now "apt" mechanism seems to be stuck in a loop

Fri Nov 09, 2018 5:11 pm

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.

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: Installation of mono-complete package caused R Pi to freeze, and now "apt" mechanism seems to be stuck in a loop

Sat Nov 10, 2018 9:46 am

Greetings.

I recently installed Mono on a Pi 3B either. I meet this issue either.

However, it's not locked. Keep patient, and wait, it would done.

Maybe more memory would help, so you could try "apt install" in CLI, no GUI.

martinu
Posts: 15
Joined: Mon Oct 08, 2018 1:09 pm

Re: Installation of mono-complete package caused R Pi to freeze, and now "apt" mechanism seems to be stuck in a loop

Sat Nov 10, 2018 10:10 am

allfox wrote:
Sat Nov 10, 2018 9:46 am
Greetings.

I recently installed Mono on a Pi 3B either. I meet this issue either.

However, it's not locked. Keep patient, and wait, it would done.

Maybe more memory would help, so you could try "apt install" in CLI, no GUI.
I decided to start again (I'd only just reinstalled the Pi when this problem happened, so I hadn't done very much customisation) and when I did this I took an image of the SD card before trying to install Mono, just in case. And Mono installed fine: as far as I could tell, it didn't even try to pre-compile vbc.exe, VBCSCompiler.exe and Microsoft.CodeAnalysis.CSharp.dll this time. I wonder what I did differently last time.

I've now got another image of the SD card after installing Mono and my app (Cumulus), and after doing a few other tweaks like setting up a printer in CUPS.

Moral of the story: it's probably worth the pain of 30 minutes of downtime while I image a 32 GB SD card at critical stages, to avoid having to go back to square one if anything critical happens - like the Pi refusing to boot and going into Emergency Boot Mode which is what started this long saga :-)

Probably the biggest lesson I've learned is to unplug the Pi from the Ethernet when doing a fresh installation from NOOBS, to avoid it trying to download an updated version of Raspbian. For most people, this would be a fairly trivial detour, but when you have to download about 3.5 GB over a 1.5 Mbps (150 kB/sec) internet connection, it is exceedingly painful :-( Disconnecting the Pi from the LAN at the crucial NOOBS boot menu forces NOOBS to use the copy of Raspbian which is bundled into NOOBS.

Now to install TVHeadend and the firmware for my TV adaptors, and get the Pi working as a PVR as well as a means of logging my weather station data. Then I can start turning off my Windows PC overnight when I'm not using it: before I got the Pi I had to leave it on 24/7 for those two tasks ;-)

conrad1
Posts: 6
Joined: Tue Nov 20, 2018 1:34 pm

Re: Installation of mono-complete package caused R Pi to freeze, and now "apt" mechanism seems to be stuck in a loop

Tue Nov 20, 2018 1:46 pm

Im experiencing the same thing:

1) sudo apt update
.. Done!

2) sudo apt dist-upgrade
.. Took a while... but Done!

according to https://www.mono-project.com/download/s ... n-raspbian
3)
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt install apt-transport-https
echo "deb https://download.mono-project.com/repo/debian stable-raspbianjessie main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
... Done

4) sudo apt install mono-devel

Downloads loads of files... got to 90% and got stuck there.

Pull the power out... and rebooted.

tried again... now it get this:

sudo dpkg --configure -a
Setting up mono-roslyn (5.16.0.179-0xamarin1+debian8b1) ...
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... <-- Took about 1 hour... Not much LED activity
Mono precompiling /usr/lib/mono/4.5/Microsoft.CodeAnalysis.VisualBasic.dll for arm... <-- Disk led always on... computer not responding.

IT IS HUNG!

Is there something i can do... have done A LOT of customisation on this box.

zardoz99
Posts: 175
Joined: Fri Jan 13, 2012 2:25 pm
Location: Somewhere in Canada.

Re: Installation of mono-complete package caused R Pi to freeze, and now "apt" mechanism seems to be stuck in a loop

Tue Nov 20, 2018 6:18 pm

Assuming that "top" is available, run that and look at the memory/swap/wait-IO levels.
I've had the same experience as you and it takes a long time, a lot of memory and a lot of disk activity.
My guess is that it is swapping heavily. On an SD card, this is a nightmare. It's bad enough on my HDD based raspbian system with an RPI 3B+.

conrad1
Posts: 6
Joined: Tue Nov 20, 2018 1:34 pm

Re: Installation of mono-complete package caused R Pi to freeze, and now "apt" mechanism seems to be stuck in a loop

Mon Dec 10, 2018 4:51 pm

In the end, even tho my Putty session issued a "broken pipe" error... i left it over night... the next day i guessed it had completed, and i typed "mono" into the CLI... and it responded!

Interesting i have done this a few times now... sometimes the exact same thing takes only a few minutes... maybe 20 min or so ... it varies a lot even using the same process to install.

Return to “General discussion”