Got linux install problems, try this!

I’ve spent the last week trying to figure out how to get monodevelop and monogame installed on a recent version of xubuntu. No one else should have to go through that pain. I’ve made a very simple shell script that will take a fresh install of xubuntu 17.10, and install monodevelop-6.0 and monogame-3.6 so that you can just get started at the fun part.

I’ve hosted the script here for the time being:
https://sites.google.com/view/kevin-days-playground/home

Edit:
Whoops, the script also replaces your ~/.vimrc with mine, and sets up git with my name, email, and preferred editor. If you understand bash scripting, after untarring, just remove that stuff. If not, give me some time, and I’ll replace the script with one that doesn’t have those extra side effects…

Edit #2:
Removed the side effects, have at it.

Ha, decent enough script, here are some of my critics on it (I’m telling you so you can improve, I don’t mean anything bad by this):

  • you can get the current user by using $USERNAME environmental variable
  • you can chain together multiple package installation like so: sudo apt install -y package1 package2
  • you are installing a lot of packages that are not needed
  • Ubuntu has a ttf-mscorefonts-installer package and just installing it will get you the fonts
  • In Linux there are a bunch of ways to automate script input, ie: echo y | sudo ./monogame.sdk, which is better than what you are doing right now
  • instead of starting MonoDevelop. you can just chmod the MD cache and config directories after installing MonoGame SDK

Awesome feedback, also a big thanks to your original project to install monodevelop. No offense taken, I’m always hoping to improve and feedback from those more experienced than you is the best way to find paths towards improvement.

That said some explanations for my reasoning behing a few of the points you bring up:

I had problems with the Ubuntu package for ttf-mscorefonts-installer(late last night, it appears to be working today though), sourceforge was having problems at the time and wasn’t letting me download the fonts, I thought others might run into the same issue with sourceforge, so I put the fonts in manually just to make sure they got there.

echo y | sudo ./monogame.sdk was the first thing I tried, but it doesn’t work. I also tried experimenting with expect, but I think I was doing it all wrong, I’m new to expect, I ended up giving up on it. I think, but admittedly I’m quite in the dark as to why, but I think it’s because the “y” is gobbled up by the launching script and never gets passed off to postinstall.sh.

I noticed if I did the chmod on the MD cache directories after installing the monogame SDK, that when I did launch MD, it wouldn’t load the monogame templates for project type.

So all a bunch of hacks to work around weird issues I experienced, but given I was working from fresh installs of xubuntu 17 in a virtualbox environment, I figured the issues would be common enough to others.

I figured I’d end up with some unneeded packages. Along my path to getting this to work, and various pre-requisites, I just kept adding to the list, and was afraid to remove from it when I changed tactics.

Would be honored to work with you on improving this script and making it the best it could be. Don’t know if you’d be open to just passing the script back and forth between DM’s or if you’d like me to add it to a github project or if you’d even be interested in collaborating on this.

Either way I will probably take your notes and make some more improvements tonight, thanks again!!

Kevin

Yea, it happens from time to time, however you are not allowed to redistribute Microsoft fonts, that is the reason why ttf-mscore package does not just package in the fonts, and also why the MonoGame installer is also not packaging them.

Do you get an error or does it just not pass the input? Also try: echo y | sudo bash ./monogame.sdk

I’m sorry, but I would rather not work on the script (I don’t really use Ubuntu that much, I’m more on Fedora and Antergos/Arch guy). I’ll still give you pointers with your script.

PS. I would improve the MG installer experience if I could, but for the most part its not hard to install MonoGame, its hard to install C# dev environment and IDE, and that is not something MG installer should do.

PPS. I’ve been thinking of mirroring official distribution support from .NET Core, and adding autodependency resolver to the monogame installer for only those few distros, thoughts?

Ah, I thought you were able to redistribute, you just weren’t allowed to modify or change the packaging. Per:
https://web.archive.org/web/19990421091853/http://www.microsoft.com:80/typography/fontpack/eula.htm

I guess I would have to supply the EULA alongside my tarball.

Opens in a new terminal window and doesn’t pass the input. Same symptoms with:

  • echo y | sudo bash ./monogame-sdk.run
  • printf “y\n” | sudo ./monogame-sdk.run |
  • sudo ./monogame-sdk.run << EOF
    Y
    EOF
  • sudo ./monogame-sdk.run < input.file
  • where input.file is a file containing “Y”

Using expect, I tried:
spawn sudo ./monogame-sdk.run
expect "Continue(Y, n): "
send “Y”

Trying a couple different variations in the send line with Y and newlines etc.
That didn’t go so well either.

I think you’re talking about something currently over my head, so I’ll decline to offer an opinion that at best would be uninformed and at worst non-sensical.

One extra thing to try is yes y | sudo ./monogame-sdk.run.

Also are you using bash, or do you use zsh/fish?

Same results.

I’m using bash

I’m quite confused as to why you are getting an extra terminal window.

Yeah, that’s been confusing for me too. It runs in the same terminal window when I execute it normally, but as soon as I try to pipe something to it, or redirect stdin I start getting a new window. Doesn’t make much sense.

Edit:
Still haven’t found a way to pass a yes to the monogame-sdk.run script to make for automated install.
Also haven’t found a workaround for starting monodevelop-stable and then killing it to get the MG project templates to show up.
However I have cleaned the script up quite a bit. Also still not using the ubuntu package for ttf-mscorefonts-installer, using the debian package, but did wrap the more manual install of fonts in an if, they only happen if the attempt to install from debian package exits with non-zero status.

A bit more cleanup of the script, and a little bit of polish to add a spinner, a log file, and make way less chatty(well less chatty on the screen anyway, the log is bigger than the old screen output). Also do cleanup of files when done.

Ubuntu ain’t that far away from siduction. Does MD work in Ubuntu ? This MD-stable ran here for a week but shows now the same bug as the old 5.10: As soon as I touch the create button of the file picker dialog window it crashes. For now I’m booting W10 and use VSC 2017.

Funny times we’re in: Wanna use FOSS, gotta boot W10. :slight_smile:

I’ve only been using virtualbox vm’s for testing so far(Easier to use snapshots and reset for iterating development of the setup script). However in a Xubuntu 17.10 VM, fresh install of the OS, run the script I linked at the top, and I’ve been able to create a new monogame project, copy/paste the getting started code from monogame’s site, and then make some modifications to it just to play around.

I have thought about using my windows box for monogame dev instead. Visual Studio is just way more polished than MD.

I always like to keep at least a set of setup instructions(if I can’t write a script) with my projects though, just to set up the dev environment, and if I should decide to collaborate, others will know the exact setup I’m working on.