Friday, January 27, 2012

Complete step-by-step guide to installing flightgear 2.4 in Ubuntu(Update 2.6 is available now)


If you follow the guide completely you will be able to run the latest version of FlightGear (2.4) with a graphical user interface to select the aircraft, location of start, resolution of the program etc in Ubuntu.

Why a guide?

The version of FlightGear available from the Ubuntu repository is 2.0.0-4. This version is old, by about 2 yrs. Further more, FlightGear launch control, a GUI front end to FlightGear  which is used to customize the program start, is not available in the official Ubuntu repository. 


You can definitely install FlightGear from the source file but it creates a lot of blocks in the form of unfilled dependencies. Also if you install flight gear alone, simple tasks such as changing airplane, scenery or resolution becomes a daunting task. This is because without the Launch Control, you have to enter the customization commands manually to the terminal and a single spelling or syntax mistake will fail the opening of the program.

Below is a sample command I would have to enter if I want to fly a F-14 from runway 28R of San Fransisco International Airport at dawn, with a resolution of 1280*800 pixels to match my screen resolution.

fgfs --airport=KSFO --runway=28R --aircraft=f-14b --geometry=1280x800 --timeofday=dawn

If you make a single spelling or syntax mistake in any of these, the system will show an error and flight gear won't run.


Lanch Control simplifies this by entering these customizing commands to the terminal for you. You just need to select your preference from the Launch Control window and it will add a corresponding parameter to the terminal.


This tutorial to install flightgear 2.4 in Ubuntu was made out of an installation in Ubuntu 11.10 Oneiric Ocelot. But the same tutorial applies to Ubuntu 11.04 (Natty Narwhal) also. Guys with 10.10 and below are out of luck here as the PlayDeb only provides FlightGear 2.0 to you.

Ok enough of the introduction, Lets cut to the chase. 


1. Add PlayDeb Repository

Playdeb offers .deb files for Flightgear 2.4 and FlightGear Launch Control. Butyou have to add Playdeb repository to your trusted vendors to install them.



Steps to add playdeb repository

You can Add PlayDeb Repository to your trusted software vendor's list by one of the two methods below
 

Semi-Automatic way:

Install Playdeb package - use this link or go to the PlayDeb.net Page

You will be asked whether to save the file or not. Save it and then double click on it to install.

Installing the Playdeb package will add the address of the repository and the GPG key automatically.

Manual way : 


Go to Software Sources - Either Select Software sources from the programs list or open Ubuntu Software Center and Select Edit >> Software sources.
Select the Tab 'Other Software' and click on 'add' button
in the small window like the one below add 

deb http://archive.getdeb.net/Ubuntu oneiric-getdeb games


click on 'Add Source'. Now the archive is added.


now we have to add the GPG key. GPG keys are used to encrypt the transfer and to ensure that y
ou are downloading from playdeb itself.

Open up a terminal, paste the following command to the prompt and hit enter

wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
That hyphen in the end is necessary.

Note: If you clicked the 'Install' button from PlayDeb's FlightGear page, without adding the PlayDeb repository to your software sources list first, a software center will open but you will see a page to install FlightGear 2.0 only.

The video below has two sections showing different behavior of Ubuntu Software center before and after the addition of playdeb repository. First when Playdeb was not added the software center just got pointed to FlightGear 2.0 only. Later when the repository was added, the software center got pointed to the newest version available, ie, FlightGear 2.4





2. Update (Synchronize) the repositories and install FlightGear

Open up Update Manager and selet 'Check' button to update the repositories. This is to add files from the newly added playdeb repository to the software center.


After successful completion of the update, you can install FlightGear from either the Ubnutu software center. Now that the playdeb's programs are added to the list of available softwares, you will see FlightGear 2.4 instead of the previous 2.0.


Its a 480Mb download so will take some time to download install. But you don't have to download that much at a single stretch. As Ubuntu software center supports resuming, you can resume the download at anytime.


3. Install FlightGear Launch Control

When the download is completed, you can straightaway start playing FlightGear by selecing it from the games list. But you will be limited to only one plane, one location and one resolution.


If you want to change the plane, location or resolution, you need to do it as commands like I mentioned earlier. Here comes the use of FlightGear Launch Control (Equivalent to Flightgear wizard in windows).



FlightGear launch control can also be installed from the Software center. But the term you have to search is 'fgrun', not 'Launch control' or anything. Even searching for 'FlightGear' won't show up the launch control in the results

Tip: You may also install FlightGear Launch control( Search for fgrun in the search window) first. As the base FlightGear program is a dependancy to the launch control, it will also be installed. This way you don't have to install them separately. 


4. Configure FlightGear launch Control

You have to enter the locations of root folder and the flightgear executable manually when you first run the launch control. Here is the way of doing that.


Open FlightGear Launch Control you will be presented with a window like the below screenshot.




You only need to fill up the first two text boxes. If you get those correctly, rest will be filled up automatically.

Box 1 Labeled 'Executable' - Enter full path of FligtGear executable
Enter 

/usr/games/fgfs
in that box. 

Box 2 Labeled 'FG_ROOT' - Enter the path to the FlightGear root file ( equivalent to the program files in windows)


Enter 

/usr/share/games/flightgear 
in the box. Or you can use the folder icon on the right side of these text boxes to navigate to the mentioned folders yourself.


Update: The completed screen look like the screenshot below ( in Ubuntu12.04)


In the next screen you can select the aircraft of your choice


The select the location from the next screen



On the last screen you can select the display resolution display effects



You can see in the lower half, the commands that are going to be fed to the terminal to bring out the customizations.

Once you have selected your variables, hit Run. If everything was entered correctly, you will run the setting of choice in flight gear


Next time when you run FlightGear launch control, you will start with the page to select the aircraft. You don't need to enter the path details again.


Note: If you feel that the mouse button is too sensitive while in yoke mode (cross), Check out Change the Mouse Sensitivity in FlightGear.


UPDATE: Flightgear 2.6 is out and it has already made its way to the PlayDeb repository. This means that you can install FlightGear 2.6 using the same method described above.
If you have already installed 2.4 you just need to run a system update.

9 comments:

  1. I can't thank you enough for writing this up! You saved me a great deal of time. I am setting up several donated machines for a flight sim lab for a Scouting troop, and have settled on Ubuntu/FlightGear as our platform. Despite working on *nix systems for the last 15 years, I haven't done much with desktop Ubuntu and found the ins and outs of the Ubuntu and the PlayDeb package manager to be an irritating learning curve. FG certainly has not done the Ubuntu user a lot of favors in distributing FG on Linux this way (compared to the simple Windows download available at the FG mirrors).

    Thanks again!

    ReplyDelete
  2. One quick update, I find that Step 3 (installing the fgrun Flight Gear Launch Control) no longer works through the playdeb or Ubuntu Software Center. I simply can't find a package with that name. I was able to easily installing it using 'sudo apt-get install fgrun' however, no problems.

    ReplyDelete
    Replies
    1. @Davin, actually it can be installed through the software center. As I stated in the third paragraph of the step 3, you need to search for the term fgrun itself. searching for 'launch control' won't work. This happens because the launch control is actually titled "graphical frontend for running FlightGear" in the software center.
      one other thing I noted is that, even though the title contain the term FlightGear, it won't show up in the results of a search for 'flightgear'.

      Delete
  3. I receive this message from the update manager.

    W:Failed to fetch http://archive.getdeb.net/Ubuntu/dists/oneiric-getdeb/games/source/Sources 404 Not Found
    , W:Failed to fetch http://archive.getdeb.net/Ubuntu/dists/oneiric-getdeb/games/binary-i386/Packages 404 Not Found
    , E:Some index files failed to download. They have been ignored, or old ones used instead.

    I've also tried updating using terminal, and receive the same message. I'm really lost on what to do now.

    ReplyDelete
  4. I was able to get the 2.6 version installed, so all is good now. It seems downloading the install play deb package link automatically, and restarting my computer did the trick. Or maybe just restarting my machine helped? Thanks for all this great information, I was really at ends trying to get flight gear to work.

    ReplyDelete
    Replies
    1. Chris,
      happy to know that everything is fine now. It took me a day to figure everything out myself and thats the reason for this article.

      Delete
  5. jasnkar, thanks for the step by step tutorial, i have downloaded the .deb package (v2.6) on my dell inspiron-1545 with 12.04, the result is disappointing, All the aircrafts are shattered, flickering, even when the material shader is disabled. fgfs v 2.6 worked well in the same laptop under ubuntu 11.10. Now in 12.04, fgfs 2.4.0-1 is in the repos, but it gives the same results as fgfs 2.6. i searched for the fgfs v 2.4, but could not locate but 2.4.0-1 is available. have any idea of solutions? (Specs: ubuntu 12.04, 64 bit- with Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07). on Dell Inspiron 1545)

    ReplyDelete
  6. Eu digito os caminhos mas ele nao carrega o restante das confg conforme vc falo

    ReplyDelete
    Replies
    1. Hi, I have added a screenshot of the completed config screen to the post. Hope that helps

      Delete

Please leave your comments here