You can either install from source, or use pre-compiled packages. We will be doing the latter.
1.) Open a terminal, and execute each of the following lines separately:
sudo add-apt-repository ppa:sao/ppa
sudo apt-get update
sudo apt-get install gemrb
Install Your Infinity Engine Game
There are a few ways to install the game for use with GemRB, but in my opinion, the easiest is to use Wine with PlayOnLinux as the front-end. If you wish, you can just install Wine (sudo apt-get install wine) and use it, but you may have to do more configuration.
1.) Install PlayOnLinux
sudo apt-get install playonlinux
2.) Install Baldur's Gate II using PlayOnLinux
*Launch PlayOnLinux and click "Install".
*Select "Games" on the left, and find "GOG.com - Baldur's Gate II Complete". Select it and click "Install"
*It will ask if you want to download the game from GOG; select appropriately
*Click "Browse" and navigate to your setup exe file (setup_baldurs_gate_2.exe) and click "Next"
*Follow the instructions to install the game
At this point, you should have a Baldur's Gate 2 icon on your desktop. If you want, you can simply run it from here using Wine. It actually runs pretty well just using Wine, but to run it natively using GemRB, we need to do a bit more:
Configure GemRB To Use Baldur's Gate II
Copy the sample config file to your desktop (execute in terminal)
cp /etc/gemrb/GemRB.cfg.sample ~/Desktop/gemrb-bg2.cfg
*Open the file that you copied to your desktop in a text editor, and modify it accordingly:
1.) Find "GameType" and set it to "bg2"
2.) Find "GameName" and set it to "Baldur's Gate 2"
GameName=Baldur's Gate 2
3.) Find "GamePath" and set it to where Wine installed your game. PlayOnLinux defaults to the following:
GamePath=~/.PlayOnLinux/wineprefix/BaldursGate2_gog/drive_c/Program Files/GOG.com/Baldurs Gate II
4.) Delete all "CD" entries except "CD1". Set CD1 to the BG2 data directory:
CD1=~/.PlayOnLinux/wineprefix/BaldursGate2_gog/drive_c/Program Files/GOG.com/Baldurs Gate II/data
5.) (Optional) change resolution
6.) Save the file.
Run The Game!
Now the fun part...running the game.
1.) Execute the following from a terminal:
gemrb -c ~/Desktop/gemrb-bg2.cfg
That's it :)