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

Xarcade2Jstick supports new Tri-Mode Tanksticks

X-Arcade Dual Joystick If you happen to own an X-Arcade Tankstick this post might be …


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

    doesnt seem to be working for me, keep getting An error.

    fatal: remote error:
    repository not found.

    • Try This

      git clone –depth=0 git://github.com/petrockblog/RetroPie-Setup.git

      • I did git clone without the depth parameter, is this a bad thing?
        can i fix it now, IVE already run the script?

      • The –depth=1 param just makes your clone of the repo “shallow” – that is, you only download the latest commit. Without it, you download about 20 megs of repository history in addition to what you actually want. In short, it’s fine.

  2. Hi
    I love the image, and have just done this with the setup script, but for some reason now I just get a white dot in the middle of the screen when it boots up. Do you have any ideas as to what I could do?


    • In some cases in the past, this was observed when the power source was too weak (<1000mA).

      Are you using the downloadable SD-card image? Od did you use the binaries- or source-based installation of the RetroPie Setup Script?

      • Hi,
        I am using the downloadable sd image, and used the binaries based installation.

      • If the white-dot-problem occurs with the SD-card image, I would guess that the power supply is too weak.

      • Thanks, do you know what you use? I have tried two different plugs, one for my phone (1000mA) and the one that came with my pi (330mA).

      • I am using this one: http://www.amazon.de/Belkin-USB-Netzadapter-iPod-iPhone/dp/B003DN3API and I have not observed any issues regarding the power source until now.

      • ok, thanks

      • Unfortunately, no I do not know it. Maybe someone else here?

      • I’ve just had a look on google and it says that the white dot is a memory split problem. How would I get to terminal with this problem?

      • If you cannot even boot up, you would need to change the configuration in /boot/config.txt by mounting the sd-card from another Linux distribution. However, the image is working in my case as is for many, many others. So, I would not bet too much on the memory split.

      • I’ve just redone the binaries installation onto a raspbian image, but when i type emulationstation into the terminal it just says no such file or directory

      • I’m having the exact same problem, had a working retropie installation

      • I will have a look into that.

      • Which emulationstation: /usr/bin/emulationstation
        df /h: ‘/h’: nocsuch file or directory
        df: no file systems processed

      • If df is not working it sounds as if there are some serious error with the (file) system. I would recommend to copy a new version of the SD-card image onto the SD-card.

      • Hi,

        Ive got an SD image and it all works now, thanks.
        However, for some reason, my retroarch.cfg has a problem where it presses back as well as down, when I press the down button. Here is the code:

        input_player1_joypad_index = “0”
        input_player1_b_axis = “+1”
        input_player1_y_axis = “-0”
        input_player1_select_btn = “2”
        input_player1_start_btn = “3”
        input_player1_up_axis = “-1”
        input_player1_down_axis = “+1”
        input_player1_left_axis = “-0”
        input_player1_right_axis = “+0”
        input_player1_a_btn = “0”
        input_player1_x_btn = “1”
        input_player1_l_btn = “4”
        input_player1_r_btn = “5”

        I thought it was a number mix up, but it doesn’t happen with the a button and the right button, which also have the same number. Could you help? Thanks

      • Maybe this works?

        input_player1_joypad_index = “0”
        input_player1_b_btn = “6”
        input_player1_y_btn = “7”
        input_player1_select_btn = “2”
        input_player1_start_btn = “3”
        input_player1_up_axis = “-1”
        input_player1_down_axis = “+1”
        input_player1_left_axis = “-0”
        input_player1_right_axis = “+0”
        input_player1_a_btn = “0”
        input_player1_x_btn = “1”
        input_player1_l_btn = “4”
        input_player1_r_btn = “5”

        The lines

        input_player1_b_axis = “+1”
        input_player1_y_axis = “-0”

        look strange – I would have expected button types in these lines.

      • Thanks, that’s that problem sorted, but now that btn has gone completely. For example, it was the accelerate in the snes version of mario kart, and the shoot button in space invaders for atari 2600. Could I map this button?

      • Could you post the output of the command jstest /dev/input/js0 here?

      • Driver version is 2.1.0.

        Joystick (USB Gamepad ) has 2 axes (X, Y)

        and 10 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4).

        Testing … (interrupt to exit)

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0:-32767 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        Axes: 0:-32767 1:-32767 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:

        off 7:off 8:off 9:off

      • Hi,
        could you give me some sort of update as to what is happening, it’s just that it has been a while since I last posted?

      • Could you try and follow the steps described in the article at http://blog.petrockblock.com/2013/12/02/retropie-autoconfig-functionality/? hope that this solves your controller issues.

      • Thanks, that has worked. Ps1 games work brilliantly, I might add

      • what is the output of the command which emulationstation? This command checks for the location of emulationstation.

        what is the output of the command df /h? This command checks for the free space.

  3. Nicholas Moore

    Does anyone know how to configure the xbox controller to drop to a terminal when hitting the home button? any help would be great. I have found a work around to play music in the retro pie. I can complete ths via ssh but would like to be able to from the controller without ssh or a local keyboard!.

  4. torturedutopian

    Hi ! First, thanks a lot for your work, it’s very much appreciated !

    However, I’m experiencing some issues regarding input. I’m using keyboard input (as I’m using the Pi in an arcade cabinet with an i-pac interface).

    Emulation station reports some “script error” when trying to setup some input settings (dgen for instance). The settings for retroarch do not report any error, but buttons do not work when starting the emulator. Well it seems to partly work actually, I managed to get the start button to work once, but for instance, not when it was mapped to “&” but when it was mapped to “x”. But then the other ingame buttons didn’t work at all (ctrl alt space etc.)

    Anyway, I was using the binary install. Trying to build the sources now 🙂

  5. By the way, you don’t need to use SSH to do this. The writer of petRockBlog only did this so they could take screenshots of it.

  6. Diego Escobar

    to install the core PicoDrive dgen emulator automatically uses it?

  7. Diego Escobar

    neo geo full screen?

    can be modified to achieve this?

  8. please tell me that I can do this on windows, too. Their command prompt isn’t a unix based console like on linux or mac, so I can’t see any way for me to get this as it appears to require console commands I am incapable of performing on my current setup.

  9. Hi everyone.

    I just got my pi a few days ago and this is exactly what I was wanting to do with it. I do have a quick question, however.

    When running the retro-pie setup script, how long did it run for you guys? I loaded raspbian and followed the instructions on the github site. I ran retropie_setup.sh last night before going to bed, compiling everything from the source distro. That was over 12 hours ago and it’s still running. This doesn’t seem normal to me, but is it? Should I start over and do something different or just continue to wait it out?

    • Depending on the overclock settings I heard from people that it takes around 16 hours. The binaries-based installation is a lot faster.

      • Thanks for the quick reply.
        I guess since I’m this far in I’ll let it continue to compile. I just wanted to make sure before I go TOO impatient and wiped my sd card and started over. 0.o

  10. I seem to be having trouble with the install, specifically the script can’t download the RetroPie theme referenced at http://downloads.petrockblock.com/RetroPieSetupThemes_290513.tar.bz2 – I get a 404 error when accessing this URL?

  11. Hi, first of all, thank you very much for this great script! Unfortunately, I get some errors: the Amiga, Atari 800, GnGeo and PPSSPP could not be compiled successfully. When looking at debug.log, it says that uae4all is not available (“/home/emulator/RetroPie/emulatorcors/uae4all/uae4all does NOT exist.”).
    I’ve selected to install all available emulators, the rPi is running raspian “wheezy” — any idea what went wrong?


  12. Hi,

    I am having a problem at the end of the compiling/installing. When the script completes, it says that RetroArch was not successfully compiled or installed. Any suggestions on how to fix this issue?

    Thanks in advance,

    • I’m having the same problem. Hopefully someone can answer this for us. Did you compile from source or binary? I did source, but I’m about to try binary and see if it works that way.

  13. Please help! Ive tried a few times, but every time the retropie script finishes compiling, the debug list says that retroarch did not install successfully, so none of the snes, nes, etc. emulators show in emulations station.

    • okay, I added roms, so now they show up, but none of them run. I’m guessing this is because retroarch failed to install correctly, So, I’m still stuck.

      • have you configured your controller in both ES and RetroArch? The first allows you to navigate the menu, the 2nd allows you control once in the game.

  14. Screamopancakes49

    Ok so I have emulation station and all that installed,as well as roms,but I’m having trouble running emulation station itself, when I try to run it from LXTerminal it tells me “X is running.please shut down X in order to mitigate problems with loosing keyboard input.for example,logout from LXDE.”
    Does that mean emulation station is open somewhere and I just can’t see it?

    • Hi there, you can’t run emulationstation from inside LXDE. You need to quit LXDE totally (I click the red ‘power’ icon in the bottom right corner of the screen and select logout). This takes you back to a terminal (not a terminal emulator like LXTerminal). From here you run the ’emulationstation’ command and it opens up.

      I hope that makes sense.

      • At this stage im sent back to a login screen rather than the terminal. If I press CTRL ALT F2 and log in, it still says that x is running even through im using the terminal screen as suggested. Can I bypass thisand open emustation anyway?

      • You need to exit LXDE completely. To put it simple, this has to do with the way, LXDE uses the graphics resources of the RPi.

      • Miguel Sousa

        isnt there a way to creat some kind of shortcut or a dual boot screen between raspien and emulationstation ?

      • William O'Meara

        when you get to the terminal type “sudo service lightdm stop” to stop the x server. Replace “stop” with “start” to return to LXDE.

      • Hello, I have stopped LDXE as you described, I was left with what I presume is the terminal (a black screen awaiting a command)
        I have typed in emulationstation, and I’m not sure if it was in the middle of something, but I am now left with a black screen and no way to input anything, any help?
        I apologise for the complete beginner SOS call, but any idea what is going on?

      • Andrius Pyleckis

        “sudo service lightdm stop” then alt+f2

      • I’ve separately installed emulationstation and n64 emulator, went to console without lxde and x running, and getting this – error while loading shared libraries: libboost_locale.so.1.55 : cannot open shared object file: No such fie or directory

        Did i forget to install something?

    • All this means is you need to log out of the desktop environment to be able to run emulation station

    • David Martinez

      I was having this issue as well. I figured out that my VNC server was keeping some form of X active. I took tightvncserver off my start up sequence, rebooted, and emulationstation was able to start.

      • How did you turn off vncserver? i keep getting X is running.please shut down X in order to mitigate problems with loosing keyboard input.for example,logout from LXDE.” when i try to start emulationstation…

      • ‘Sudo service lightdm stop ‘ should let u run emulationstation

      • I have emulation station set to start on bootup. I can get back to the desktop with f4, but cant get back into emulationstatio, even when I use sudo…stop. I get a black screen. I tried sudo…stop followed by altf2,but was then asked for a username and pw, which I never set up. Any help would be appreciated.

      • Figured it out. I created a user name and pw, entered it where I mentioned before. Then entered ’emulationstation’ to get back in. From then on, I didn’t need to add my username and pw anymore, just ’emulationstation’.

  15. I don’t understand … WHERE ARE THE ROMS FOR RETROPIE? I looked in the folder named ‘roms’, but they aren’t there. Please help.

  16. Hello, petRock! Can you help me use xbmc like front-end for retro-pie?

  17. nicholas moore

    I have been having issues getting my config files for a wired Xbox 360 controller. The issue is inside the emulator its self. The drive works fine and the device is functional. I have tried a few def methods with no luck. Would someone be able to provide an image with the retro-pi being setup with a wired xbox 360 controller in the nes and snes emulators? I can provide a share drop box. Thanks!

  18. Hey I’m hoping someone can help me out. Ive set up RetroPie and my wireless controller seems to work but I cant seem get any roms to open up. It only opens Apple II and then I have to use my keyboard to exit out. My roms have the correct file extensions but I can figure out how to get them to open. Also I dont see an option for this Cave game that keeps getting mentioned. Any ideas?

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.