RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Noninteractive installation/upgrades?

    Scheduled Pinned Locked Moved Help and Support
    updatesinstallation
    9 Posts 4 Posters 2.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nschloe
      last edited by

      I have a nightly cron job running that updates all my base system packages. I would like to do the same thing with the RetroPie packages. Right now, I don't see a way to that noninteractively though – you always have to launch the retropie_setup.sh and click your way through.

      Likewise, I'd like to codify my RetroPie installation in an Ansible script, for which I need one or more noninteractive commands to install RetroPie.

      Any hints here?

      AlexMurphyA 1 Reply Last reply Reply Quote 0
      • AlexMurphyA
        AlexMurphy Banned @nschloe
        last edited by AlexMurphy

        @nschloe I would definitely say this is possible, depending of course on your skills. The retropie_setup.sh script really just launches the GUI, if you are doing it automatically this is not needed. Have a look in /home/pi/RetroPie-Setup the have a look in the scriptmodules and tools directories. Everything you need is in there, I think.
        If you do this post it here, I and many others would definitely be interested in automating updates using a cron job or single command / script. I'd give it a go myself but I'm not much of a coder. The furthest I have gotten is launching the setup script form a command line menu I made by entering a number choice... saves me a few clicks at least.

        1 Reply Last reply Reply Quote 0
        • BuZzB
          BuZz administrators
          last edited by BuZz

          sudo ./retropie_packages.sh
          

          everything that can be done through the GUI in regards to installing etc can be done from commandline.

          A default image is set up like this - see scriptmodules/admin/image.sh - a few adjustments are made to the filesystem - hostname / cmdline.txt and then the following is done to install:

          #!/bin/bash
          cd
          sudo apt-get update
          sudo apt-get -y install git dialog xmlstarlet joystick
          git clone https://github.com/RetroPie/RetroPie-Setup.git
          modules=(
              'raspbiantools apt_upgrade'
              'setup basic_install'
              'bluetooth depends'
              'raspbiantools enable_modules'
              'autostart enable'
              'usbromservice'
              'usbromservice enable'
              'samba depends'
              'samba install_shares'
              'splashscreen default'
              'splashscreen enable'
              'bashwelcometweak'
              'xpad'
          )
          for module in "${modules[@]}"; do
              sudo __nodialog=1 ./retropie_packages.sh $module
          done

          To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

          N 1 Reply Last reply Reply Quote 3
          • N
            nschloe @BuZz
            last edited by

            Thanks @BuZz, I can definitely use that for provisioning.

            Any hint on how to do upgrades with RetroPie?

            BuZzB 1 Reply Last reply Reply Quote 0
            • BuZzB
              BuZz administrators @nschloe
              last edited by

              @nschloe check retropie packages output / setup module functions.

              To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

              1 Reply Last reply Reply Quote 0
              • N
                nschloe
                last edited by

                The only thing I've found so far is

                sudo ./retropie_packages.sh setup post_update update_packages_gui_setup update
                

                which does do an update, but is still interactive (Are you sure you want to update installed packages?).

                F 1 Reply Last reply Reply Quote 0
                • F
                  franklesniak @nschloe
                  last edited by

                  @nschloe I've been working on this as well, trying to build a script to automatically update my RetroPie, and I came across your post. I have the following script but still cannot get around the prompts:

                  cd
                  cd RetroPie-Setup/
                  git pull
                  chmod +x retropie_setup.sh
                  chmod +x retropie_packages.sh
                  sudo apt-get update
                  sudo apt-get -y dist-upgrade
                  printf 'o\ny\no\n' | sudo ./retropie_packages.sh setup post_update update_packages_gui_setup update
                  sudo shutdown -r -t 0
                  
                  BuZzB 1 Reply Last reply Reply Quote 0
                  • BuZzB
                    BuZz administrators @franklesniak
                    last edited by BuZz

                    @franklesniak You have posted on 2 threads and opened an issue on the issue tracker. This is not the way to get my help - I have replied on the issue tracker with the answer, but please follow the guidance provided when asking questions.

                    # do not run this often as it will put strain on our server - weekly should be enough
                    cd ~/RetroPie-Setup/
                    git pull
                    sudo __nodialog=1 ./retropie_packages.sh setup post_update
                    sudo __nodialog=1 ./retropie_packages.sh setup update_packages 
                    sudo __nodialog=1 ./retropie_packages.sh raspbiantools apt_upgrade
                    

                    To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                    F 1 Reply Last reply Reply Quote 0
                    • F
                      franklesniak @BuZz
                      last edited by

                      @buzz thank you very much for the help! Quick question --

                      It seemed like the RetroPie setup script runs apt-get update and apt-get -y dist-upgrade before calling post_update and update_packages. Do I have that right? If so, should the order of the commands be?:

                      # do not run this often as it will put strain on our server - weekly should be enough
                      cd ~/RetroPie-Setup/
                      git pull
                      sudo __nodialog=1 ./retropie_packages.sh raspbiantools apt_upgrade
                      sudo __nodialog=1 ./retropie_packages.sh setup post_update
                      sudo __nodialog=1 ./retropie_packages.sh setup update_packages 
                      

                      Also, is there anything special about the raspbiantools apt_upgrade function(s) vs. just running?:

                      sudo apt-get update
                      sudo apt-get -y dist-upgrade
                      

                      Just trying to figure out what is best before calling this "done". Thanks again!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                      Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.