Home » RetroPie Project » RetroPie-Setup: An initialization script for RetroArch on the Raspberry Pi

RetroPie-Setup: An initialization script for RetroArch on the Raspberry Pi

If you want to install and setup RetroArch on the Raspberry Pi (TM) together with various emulator cores, all needed libraries for the SNESDev controller interface, and a graphical front end you can now go to https://github.com/retropie/RetroPie-Setup. There you will find an easy-to-use script that installs all essential packages for retro gaming on the Raspberry. I call it RetroPie script.

I prepared a Github repository with a shell script that automatically installs all needed packages. It has a console-based GUI and makes the installation of everything you need for retro gaming very easy. The script was tested on the Raspbian distribution. The following instructions can also be found directly on the Github site.


To obtain the installation script you first need to install two packages with

sudo apt-get update
sudo apt-get install -y git dialog

Then you can download the latest RetroPie setup script with

git clone git://github.com/petrockblog/RetroPie-Setup.git


The script is executed with

cd RetroPie-Setup
chmod +x retropie_setup.sh
sudo ./retropie_setup.sh

You are welcomed with the following screen

Here, you have the choice between two different ways of installation:

  1. Binaries-based installation: This way of installation will download per-compiled versions of RetroArch, various cores, Emulation Station, and SNESDev. In comparison to the second way of installation this is much faster. Even though the binaries will be updated from time to time, a disadvantage is that you probably will not have the most recent versions of the programs.
  2. Source-code based installation: This way of installation will download and compile the most recentsources of all programs and cores. Compiling everything takes some hours, but you will have the most up-to-date releases of the programs. When you choose this option in the menu a screen will appear that lets you select (with the space and arrow keys) the individual tasks to be done by the setup script:

    The default selection will install the complete set of packages.


With it’s default configuration the RetroPie setup configures the graphical front end EmulationStation such that a set of emulators can directly be used by the front end. You can start the front end with


Before that, however, you need to copy your ROM files into the according RetroPie/roms/ folders. Every emulator has its own subfolder here. Due to the early stage of the ALSA implementation on the Raspberry you can expect some creaking when using the analog output. I made quite good experiences with the HDMI output. For now, another solution for that seems to be the use of an external USB soundcard until the problems with the ALSA implementation are solved.

I really would like to see this script be further developed by you and me!! I think that Github is the right place for that.


Check Also

Quick Installation Script for the ControlBlock

We realized that the installation of the ControlBlock driver could be simplified. Therefore, we created …


  1. What are the default key bindings for mame games? I can get it run, but can never insert a coin or start the game. Im using a keyboard. Or at least wheres the config file to change the key bindings?

    Hopefully performance will increase over time, even NES games are basically unplayable. 🙁

  2. fidelgvelasquez

    I am currently using the standard Raspbian distribution (2012-08-16), and I installed from source (it didn’t take as long as I had expected), but when I tried to start it for the first time (with no ROMs in the folders), all that happened was a white dot showed up in the middle of the screen. I tried again later, after adding ROMs, but it still didn’t work. I am using a 5V 2A power adapter, an Apple Aluminum Keyboard, a 16GB micro SD (not sure what class, probably 4) with an adapter, and I have my Raspberry Pi overclocked to 900 MHz with 500 MHz SD RAM frequency. I have tested on both HDMI (at 1920×1080) and composite (RCA) video (not sure what resolution, but it was 4:3), and with and without ethernet plugged in. Any suggestions?

  3. Hi there, I installed RetroPie and put some roms in the /roms/snes/ folder. When I start emulationstation, I can see a list of my roms and can select one of them with the UP and DOWN keys (keyboard). But I cant start a rom. I have tried any other key on my keyboard but nothing happened.

    I also dont have a es_input.cfg in my home/pi/.emulationstation/ folder.

    Please help

  4. Hi Florian,
    I followed some steps you posted in another forum and removed the install completely, re cloned the git and re-ran the install script. It worked like a charm!
    Thanks Again,

  5. Hi,

    I went ahead and followed your steps to getting EmulationStation/RetroArch installed on my system today. I followed the Binaries method, as I doubt building from source would be worth it for me. I received the es_systems.cfg error that was described earlier. Is it possible a change was made to the script since? Or should I be looking for something wrong on my end?


    • Hi Brian,

      I will check this later today! Update: I ran the script on a fresh Raspbian installation and everything worked out of the box.

      Until then you can first of all try to start a ROM from the command line (https://github.com/retropie/RetroPie-Setup/wiki/How-would-I-start-from-command-line,-say,-the-SNES-emulator-by-itself%3F)
      If this works, it is “just” a problem with the es_systems.cfg. Take care for lower- and uppercase extensions:
      Atari 2600: .bin
      Doom: .WAD
      Game Boy Advance: .gba
      Game Boy Color: .gbc
      MAME: .zip
      Megadrive: smd
      NES: .nes
      SNES: .smc

      • Thanks for getting back to me so quick! I will try to run it from command line first, if that doesn’t work, I looked at the script so I will just write the es_systems.cfg myself.

      • I have found a bug in the binaries-based installation that affects the access rights to the EmulationStation configurations. The repository was just updated and the fixed script might also solve your problem!?

  6. Somehow the Source-code based installation doesn’t work for me, i tried it last week and afterwards i couldn’t get the Raspberry to boot, i was stuck with a single red LED.
    After that i tried the faster binaries-installation, which worked withouth problems.
    Now i wanted to give the Source-code based installation a new chance as i wanted to have the newest, best running emulators, and again i’m stuck with the red LED.

    Running on a fresh Raspbian, during the installation i got errormessages that no space was available, and it couldn’t write.

    • It seems as if you might not have your resized your partition to its full size.
      You can check this with the command “df -h”. /dev/root shows you the free space of your “main” partition. What size does your SD card have? You can do a resize of your partition with the shell command “sudo raspi-config” and then choosing “expand_rootfs”. You need to reboot your Raspberry with “sudo reboot” afterwards.
      Does this solve your problem?

      I have updated the free space check in the script. It now checks for 500MB of free space (it was 300MB before).

      • Thanks for the fast reply,
        resizing the partition did the job, i had 332MB free space
        Now i just need to tackle a few more problems and i’m ready to play secret of mana again =)
        I have the sound barely working and my dualshock2 controller via usb-adapter isn’t always working as it should be.
        Is there an FAQ somewhere to be found? It is a little bit frustrating to keep digging through 4 threads on the Rpi forums that are related to Retroarch and comments on your blog for every little problem someone has perfectly answered before.
        Also i would like to have a list of all the keybindings of the keyboard to the emulationstation and the emulatorcores.

        I’m sorry if I just came up with more problems and questions but I would really love to be able to use Retroarch in all its Glory =)

      • Good to hear that you are making progress!
        Hmm, Besides the official forum, I do not know any FAQ for running RetroArch etc. on the Pi. I have prepared a wiki on the RetroPie setup site at https://github.com/retropie/RetroPie-Setup/wiki. Right now, there is no content. But that wiki could serve as a source of all kinds of collected information around the components that are installed with the RetroPie setup script.

        WRT to Emulation Station: You can use the arrow keys for navigation, the F1 key for reboot and shutdown, and the F4 key for exiting Emulation Station.

        All settings for retroarch can be found in /etc/retroarch.cfg (if you use only the original RetroPie script) or, alternatively, in your home directory at ~/.retroarch.cfg.

        Sound is an ubiquitous problem with the RPi and is tackled by the community these weeks and months (at least that’s my impression).

  7. Running into a problem with starting emulationstation and retroarch — both are giving me bash “No such file or directory” errors. The binaries appear to be where they should be, and they both are marked as executable. Also, ldd is telling me that all the .so files are being found… Any thoughts?

    • Hmm, I tested the current release again and everything is working here. I tested it on a fresh Raspbian installation by following the exact steps that are described above.. Everything must be run from the shell only, without X running in the background.

  8. HI there, Sorry if this is a really stupid question, but I have gone through the installation script and used the binaries based install. All seemed ok.
    I then put some game roms into a few of the system folders, (snes, gbc, gba and atari 2600).
    I then turn on my pi, log in, and then type emulationstation.
    It then returns with :
    ~/RetroPie/EmulationStation ~
    ~mulationStation cleanly shutting down…te it.ion / es_system.cfg was found but contained no systems

    Being a complete linux novice on a steep learning curve, I haven’t a clue what this is referring to. 8/
    Thanks in advance 😀

    • Hi Gubernatio,
      I just checked this and I found a bug in the script – thank you for pointing me to that one!
      I commited a fix for that that should solve this problem. For you the easiest thing would be to delete the RetroPie-Setup folder and to download and start the setup script again (as described at https://github.com/retropie/RetroPie-Setup). You can then run the binaries-based installation again and things should work!
      Please tell me if this solved your problem.

      • Thanks for the quick reply!
        I think that helped as I now get into the menu system! yay
        However I don’t seem to be able to start any games. Only F4 on keyboard or Start button on the gamepad seem to do anything, and that’s to open a Restart/Shutdown menu. Am I supposed to do anything to the emulators like add bios files?

      • Make sure that the extensions of your rom file are written in lower-case letters (except for Doom, there it is “.WAD”).

        Instead of starting the ROMs with EmulationStation, you could also try to start them directly from the console.

        cat ~/.emulationstation/es_systems.cfg

        shows you the commands that EmulationStation is using to start the ROMs. You have to replace %ROM% with the path to your desired rom file.

        I hope this helps?!

  9. Has anyone used this running raspbmc? I was wanting to play NES roms using xbmc with the advanced launcher plugin. I’m not sure what to launch though: Emulation Station/Retro Arcade/NES specific emulator?

    • we tried to get it running in raspbmc…
      In Rom Collection browser and in Advanced launcher .. but no proffit so far 🙁

    • I got the RetroPie suite (including retroarch) compiled on raspbmc. In trying to compile retroarch manually I noticed it was looking for several header files which on the wheezy platform exist in /opt/vc/include. These files are put there when the firmware is updated via raspi-config.

      The reason raspi-config won’t run is because the ca-certificates package is missing from raspbmc. So,

      # sudo apt-get install ca-certificates

      Once this dependancy was installed I was able to get through the full source build of RetroPie — including, most importantly, the firmware update which installs the missing headers.

      • Thanks for that hint!
        I will add this to the RetroPie Setup Script. Just to be sure: Did you use the raspi-config or the rpi-update script to update the firmware?

      • I just chceked my command history, and indeed it was rpi-update. Sorry — I mixed the two up.

        Upon installing the ca-certificates package, I did a git clone of git://github.com/Hexxeh/rpi-update.git. I ran rpi-update manully to confirm that it installs the header files in /opt/vc/include.

        Once those files were in place, running the full source build in retropie-setup.sh worked with no errors (which included re-running rpi-update …. for good measure! )

      • I’m trying to install retropie on raspbmc but not being very successful.. it’s breaking raspbmc.. shortly after the installation of retropie starts it asks me if i want to replace or leave udev, udev.conf and a couple of other udev files… i also tried the steps ca-certificates and rpi-update to add header files btu when i check in opt/vc there is no include folder? how would i fix this?

  10. Thanks so much for this–I installed the binaries very easily and set up the NES, SNES, and 2600 emulators. I do have one question: I’m trying to use a Logitech F510 Joypad with an xbox layout. When I try to run retroarch-joyconfig, it doesn’t detect the gamepad. It shows up if I run lsusb, but retroarch doesn’t seem to detect it. If anyone has any suggestions, I’d really appreciate your help.

  11. I wanted to update my installation, so I did a rm rf Retropie* … When I execute the setup script, all I get is, well, nothing 🙂

    This is what happens: https://dl.dropbox.com/u/3851166/retropie.png

    • Hmm, I just checked this behavior myself with the root user. I run the script with ./retropie_setup.sh and everything works. Maybe you were still in an already removed directory? Usually removing RetroPie and RetroPie-Setup with “rm -rf RetroPie…” followed by a new git clone should give you a completely fresh installation.
      Could you maybe try to describe how this can be reproduced?

  12. I was reading in the Pi forum a thread concerning setting up the wireless USB Xbox 360 controller. I looked on Amazon for one of the USB connectors (as I have an old controller laying around) and noticed that there are two of them. A Microsoft (expensive) one for $21.99 and a cheaper Xbox 360 one for $12.45. Has anyone tried the cheaper one, do you know if it works or not the same as the Microsoft brand one?

  13. hello, I am really greatful for this script, I have RetroArch up & running on my Pi, with snes ROMS tested & working.

    I’m struggling with joypad setup. I have a logitech USB PS3 controlelr which seems to work with the Pi. I have managed to configure navigating the emulators/ROM lists with the joypad but cant seem to get it to work with the SNES emulator. I have tried running retroarch-joyconfig however I always get “command not found”

    Is there another way to set up the gamepad for use withing the snes emulator>? Can anybody help?


    • In terminal (before startx), browse to the folder where the retroarch-joyconfig is (default should be /home/pi/RetroPie/RetroArch-Rpi/tools) then use the command

      This will get the joyconfig running.

      I’m still stuck after this. Some of the buttons don’t register for some reason, and the ones that do, don’t write themself to the configuration. I took note of which button is which, and then tried to apply them manually to the retroarch.cfg, but I must be doing something wrong, because it’s not working.

      • Hey, thankyou for the reply. I was getting nowhere without the “./” at the beginning of retroarch-joyconfig! Linux n00b eh?

        I can help you with your problem, running the retroarch-joyconfig alone isnt enough, the output need to be written (appended) to the retroarch.cfg file so it remains after reboot.

        I think the exact command to use is “./retroarch-joyconfig >> ~/.retroarch.cfg”

        Then run the button config again!

  14. Hi I’ve started to use this and love it.
    I was just wondering is there any way of starting Emulationstation on boot instead of going into the terminal and manually starting it. The reason being is I want to turn on my Pi with Joypad attached and not have to do anything through a keyboard or SSH.

    Great work though as you’ve simplified a huge process!

  15. Florian, update the retroarch.cfg file with audio_out_rate = 44100
    Using that config the ALSA sound coming from the headphone jack is a lot clearer and has a lot less static.

  16. So I installed this… how would I start from command line, say, the SNES emulator by itself?

  17. Thanks!
    And now my my problems with binding is solved: config string for gamepad buttons should be input_exit_emulator_btn = “6″ instead of input_exit_emulator = “6″ for keydoard.
    Welcome to my blog (russian language, but we have google translate=)

  18. Great! I’m making retro-emulation console too, but with standard USB gamepads. And put it to Russian famiclone called Dendy Revolver.
    1. When I try to launch emulationstation, it says “missed font”, until I place font to the /home/raspbian folder.
    2. I’m get a problem like a Lukeren says. My USB keyboard get off when I start game. But can I bind system hotkeys (exit game, etc) to the joypad buttons? How I can made it? I’m try to write input_exit_emulator = “6” (or just 6), but it don’t work.
    3. EmulationStation curses to roms named with “(“, “[” and “&” characters, its normally?
    4. If you want to make EmulationStation more beatiful, I can help you with graphical elements. Send me e-mail if you want. Or maybe you try Typhon as frontend?

  19. I’ve got it working great for SNES (only thing I’ve used so far), but I’m having a bit of a problem with exiting a game.
    F4 works while at the menu (emulationstation), but the keyboard appears dead (caps lock/numlock doesn’t work) when a game is running.
    Am I missing a setting somewhere?

    • This question may be put in the wrong place, I’ll post it on the raspberry forum instead 😉

    • I observed that the Rasperry is very sensitive to the power source. If you have the possibility I would suggest to try another source with at least 1A (1000mA). Or another USB keyboard or an active USB hub.

      • I’ll have to see if I can’t get my hands on one then, I’ve got an extra Apple charger, that should supply sufficient power, just need a cable that fits 🙂

    • You can try running it not in the xserver but in another console like ctrl+alt+f1, log in and start emulation station.
      My keyboard then wasnt dead and I can exit a game with esc, f4 closes the whole emulator.
      Nothing is saved when I use esc, at least I think so.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

We use Cookies and similar technology to collect and analyse information about the users of this website. We use this information to enhance the content, advertising and other services available on the site. Please click ‘Accept cookies’ to consent to the use of this technology by petrockblock. You can manage your preferences at any time by visiting our Cookies Policy page.