Noninteractive installation/upgrades?
-
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?
-
@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. -
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
-
Thanks @BuZz, I can definitely use that for provisioning.
Any hint on how to do upgrades with RetroPie?
-
@nschloe check retropie packages output / setup module functions.
-
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?
). -
@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
-
@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
-
@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!
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.