I recently had to install Moonlight (Silverlight on Linux) on Ubuntu 7.04. The Moonlight plug-in for Firefox is not available as a binary package and needs to be compiled from source. Moonlight has dependencies on Mono. The instructions on the Moonlight project page are not sufficient for a casual Linux user like me. Fortunately, this thread at the mono-olive group came to my rescue (thanks Chris!). I am reproducing its contents with minor changes and slightly more detailed instructions:

The instructions assume that you have a clean installation of Ubuntu 7.04 up and running on your machine. Fire up Terminal. First we’ll update the Ubuntu package list and install Subversion on our machine. The commands to accomplish this require admin privileges and we’ll be using sudo to execute them. Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation. When sudo prompts you for a password, just key-in the password of the account that you’ve used for logging into your current session.

sudo apt-get update
sudo apt-get install subversion

If you are attempting this at work, chances are you are behind a proxy. In which case apt-get will give you errors. Use the following command to indicate your proxy server and type the above commands again.

export http_proxy=http://YourProxyName:Port
sudo apt-get update
sudo apt-get install subversion

We’ll now create a folder for Mono source and pull down the required bits.

mkdir mono
cd mono
svn co svn://anonsvn.mono-project.com/source/trunk/mcs
svn co svn://anonsvn.mono-project.com/source/trunk/mono
svn co svn://anonsvn.mono-project.com/source/trunk/gtk-sharp
svn co svn://anonsvn.mono-project.com/source/trunk/gnome-sharp
svn co svn://anonsvn.mono-project.com/source/trunk/olive
svn co svn://anonsvn.mono-project.com/source/trunk/moon
svn co svn://anonsvn.mono-project.com/source/trunk/monodoc

Again, if you are behind a proxy, things will need to be done a little differently. The above commands would have given you errors. Go to the .subversion folder under your home directory open the file called “servers”.

cd ~/.subversion
vi servers

If you are from the Windows world and don’t know how to use vi, use gedit:

gedit servers

Scroll down to the end of the file, and add the following lines. Save and exit your text editor.

http-proxy-host  = sinproxy
http-proxy-port =  80

We’ll also need to re-run the svn commands. Notice that this time we’ll use the http:// prefix instead of svn://.

svn co http://anonsvn.mono-project.com/source/trunk/mcs
svn co http://anonsvn.mono-project.com/source/trunk/mono
svn co http://anonsvn.mono-project.com/source/trunk/gtk-sharp
svn co http://anonsvn.mono-project.com/source/trunk/gnome-sharp
svn co http://anonsvn.mono-project.com/source/trunk/olive
svn co http://anonsvn.mono-project.com/source/trunk/moon
svn co http://anonsvn.mono-project.com/source/trunk/monodoc

We’ll use apt-get again to install dependencies and tools required to build Mono and Moonlight.

sudo apt-get install libavcodec0d libavformat0d libgtk2.0-dev libnspr-dev firefox-dev libavcodec-dev libavformat-dev libasound2-dev librsvg2-dev
sudo apt-get install autoconf automake libtool build-essential bison

One of the dependencies required for Moonlight to build (libswscale-dev), is not available for Ubuntu 7.04 but is available from the upcoming 7.10 release. We’ll use a tool called prevu to backport the package’s 7.10 version to our present 7.04 installaiton. First, we’ll need to install prevu itself.

sudo apt-get install prevu

Next we setup the prevu environment. This step requires a few hundred megs of space under /var, and takes a while to finish.

sudo prevu-init

We now need to instruct prevu to pick the libswscale-dev package from the 7.10 repositories. Go to /etc/apt and edit the sources.list file.

cd /etc/apt
sudo vi sources.list

Add the following line right at the end of this file and save it.

deb-src http://us.archive.ubuntu.com/ubuntu gutsy main universe restricted multiverse

Next, we retrieve and build libswscale-dev.

sudo apt-get update
prevu libswscale-dev

The step above will again take a while to finish. If all goes well, you’ll have a bunch of .deb packages under /var/cache/prevu/feisty-debs that can be installed. Ignore any errors/warnings about being unable to install ffmpeg.

cd /var/cache/prevu/feisty-debs
sudo dpkg -i *.deb

We are a step or two short of being able to build Mono and Moonlight. To build Mono we need a working copy of the Mono runtime and the Mono C# compiler (mcs).

cd ~
sudo apt-get install mono-mcs

You might get some errors in the step above about missing dependencies. The following command should install the dependencies.

sudo apt-get -f install
sudo apt-get install mono-mcs

We also need to patch the Mono source for Moonlight to work. Browse to: http://tirania.org/tmp/mono-delegate-appdomain-patch using Firefox, select everything and save it to a text file (call it mono-delegate-appdomain-patch) in the mono/mono/mono under your home directory. In case you are wondering about the three mono folders – the first one was created by you, the second one got created when you retrieved the mono branch using svn and the third one came along with the mono source. Let’s switch back to the terminal window and apply the patch that we just saved.

cd ~/mono/mono/mono
patch -p0 < mono-delegate-appdomain-patch
cd ..

We are now ready to build Mono and co.

./autogen.sh --prefix=/usr --with-moonlight=yes
make
sudo apt-get remove mono-mcs
sudo apt-get autoremove
sudo make install
cd ../olive
./configure --prefix=/usr
make
sudo make install
cd gtk-sharp
./boostrap-2.10 --prefix=/usr
make
sudo make install
cd ../monodoc
./autogen.sh --prefix=/usr
make
make install
cd ../gnome-sharp
./bootstrap-2.16 --prefix=/usr
make
sudo make install
cd ../moon
./autogen.sh --prefix=/usr
make
sudo make install

This builds Mono and the Moonlight Firefox plug-in. We install it as follows.

sudo cp *.so moonlight.exe /usr/lib/mozilla-firefox/plugins
sudo ln -s /usr/lib/mono /usr/lib/mono/3.0

Launch Firefox and type about:plugins into the address bar. The Moonlight plugin will be listed on top (on my build it was called Silverlight). Visit any of the samples at the Silverlight website to check your installation or take the Silverlight Airlines demo for a spin!

Using WMIC For Gathering System Info
It’s lonely out here
  • http://www.freelancewebdesigner.me Freelance web designer

    Ubuntu is my best os ever.

  • http://www.sunglassesuk.com/s1/snowboard_goggles/snowboard_goggles.asp Snowboard Goggles

    there are several Os you can choose from and each one of them has a unique features that will amaze you, they are maintaining this for the competition they are dealing with.

  • http://www.setpointusa.com/industrial-automation.html Assembly Equipment

    there are several Os you can choose from and each one of them has a unique features that will amaze you, they are maintaining this for the competition they are dealing with.

  • http://www.stuckincustoms.com/slr-camera/ SLR Camera

    Ubun tu is the best os now a days it really cool…

  • http://www.evokedesign.com miami web design

    Unfortunately, the Moonlight plug-in for Firefox is not available as a binary package and needs to be compiled from source.

  • http://www.frames4sale.com/Sunglasses/Prada.html Prada Sunglasses

    The commands to accomplish this require admin privileges and we’ll be using sudo to execute them. Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation!

    Thanks

  • http://thestyleshopper.com/ed-hardy/ed-hardy-bags-and-purses/ Ed Hardy Bags

    Ubuntu is, definitely best OS! The Moonlight plug-in for Firefox is really good though it should get available in binary number :)

  • http://www.online-poker-texas-holdem.de/ Online Poker

    Ok, so Ubuntu is surely one of the best linux Software!

  • http://www.lets-do-diy.com/Projects-and-advice/Electrical/Preparing-the-circuit-route.aspx Preparingthecircuitroute

    I dont know about you but it work for me very well:) I love this plugin.

    Thanks and Reagrds

  • http://www.lets-do-diy.com/Projects-and-advice/Electrical/Replacing-sockets.aspx replacing electrical sockets

    I dont know about you guys but this this isnt working for me!

  • http://www.lets-do-diy.com/Projects-and-advice/Electrical/TV-aerials.aspx installing tv aerials

    Ubuntu has done a great job this time creating a superb plug-in that is working smoothly for me:)

    Thanks and Regards.

  • http://www.lets-do-diy.com/Projects-and-advice/Electrical/Two-way-switches.aspx installing twoway switches

    I also really like this plug-in I think it cant get any better then this, You have done great job!

  • http://www.lets-do-diy.com/Projects-and-advice/Heating/Underfloor-heating.aspx installing underfloor heating

    Yes he is the best:)

  • http://www.memorybits.co.uk/mobile_accessories Mobile Phone Accessories

    Unfortunately, the Moonlight plug-in for Firefox is not available as a binary package and needs to be compiled from source,

  • http://www.snaptint.com Window Tint

    Well, Ubuntu have to come up with some other softwares..

  • http://www.tintcenter.com Window Film

    When sudo prompts you for a password, just key-in the password of the account that you’ve used for logging into your current session

  • http://www.pet-chauffeurs.co.uk/ Pet Travel

    Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation.

  • http://www.propeller.com/member/zara454/ Aryan

    I didn't know this earlier. Thanks for informing. Now I am also using Ubuntu. It is very easy to work with it.

  • http://www.uk-cheapest.co.uk/ Domain Names

    Hi “Freelance Web Design”, so you create Ubuntu all by yourself? It's a great OS you made there! Well done mate! Unbuntu rocks either way :)

  • madhavg57

    Ubunto is the best. I have been using it since many months. It has never given problem to me.

  • http://www.coloradomesotheliomalawyers.net/ mesothelioma_lawyer

    I'll back again for sure, thanks for great article :D

  • http://www.irwins-study.com/ Skin Care Store

    The commands to accomplish this require admin privileges and we’ll be using sudo to execute them. Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation!

  • http://credit-card-processing.123vendors.com/index.asp phone credit card processing

    The commands to accomplish this require admin privileges and we’ll be using sudo to execute them. Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation!

  • http://credit-card-processing.123vendors.com/index.asp phone credit card processing

    When sudo prompts you for a password, just key-in the password of the account that you’ve used for logging into your current session

  • http://www.gametrailers.com/users/anunn/ Annun

    I have a question. Does this piece of commands still work with other Linux like Redhat? Thanks.

  • http://unilinkinc.com/check_scanner.php check scanner

    Ubuntu sure do had created a good reputation to its users, well this OS had simply proved that it is one of the best

  • http://www.cosmeticdentistryguide.co.uk/dentists/surrey-cosmetic-dentist.html cosmetic dentists surrey

    I am visiting this site for the first time and I am completely agreeing with you guys he is the best.

  • http://woolarearugsguide.com wool area rugs

    I have used this plugin at my site and it is really useful. Thanks for the additional tip though.

  • http://www.lernerlemongello.com/ Dentists Palm Beach

    we’ll be using sudo to execute them. Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation! The Moonlight plug-in for Firefox is really good though it should get available in binary number :)

  • brightondentist

    It actually takes some time to get hang of it.. buts isnt it a wonderful OS.. just love the flexibility.. and not spoon feeding as windows does..

    Dentists in Brighton

  • http://www.usa-basketball-shoes.com Kobe Bryant Shoes

    Here elaborates the matter not only extensively but also detailly .I support the
    write's unique point.It is useful and benefit to your daily life.Nike Zoom LeBron James Soldier