cooka
Posts: 2
Joined: Wed Apr 12, 2017 7:35 pm

Updating Pis

Fri Jan 17, 2020 4:26 pm

:geek: Hi guys,

I have been using raspberry pis for a while but new to the forum. I was wondering if such a thing exists, I currently have 50+ rpis deployed at different sites, all they run is a chrome page in kiosk mode mainly. I would like to keep them all up to date etc without having to manually ssl/vnc into each one. Is there a way I can put them in one place, have them check in on my network and update them automatically?

Can i do anything with linux server?

Any suggestions welcome.

Maze_fr
Posts: 46
Joined: Wed Dec 04, 2019 9:57 pm
Location: France

Re: Updating Pis

Fri Jan 17, 2020 4:41 pm

Maybe you could put all your command line in one script and launch it in a cron ?
"Don't believe in forum signature quotations, they may be fakes" - Victor Hugo

jahboater
Posts: 5175
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Updating Pis

Fri Jan 17, 2020 4:41 pm

cooka wrote:
Fri Jan 17, 2020 4:26 pm
:geek: Hi guys,

I have been using raspberry pis for a while but new to the forum. I was wondering if such a thing exists, I currently have 50+ rpis deployed at different sites, all they run is a chrome page in kiosk mode mainly. I would like to keep them all up to date etc without having to manually ssl/vnc into each one. Is there a way I can put them in one place, have them check in on my network and update them automatically?

Can i do anything with linux server?

Any suggestions welcome.
You could have a simple script.
Something like:

ssh -t pi@host1 'sudo apt update && sudo apt upgrade -y'
ssh -t pi@host2 'sudo apt update && sudo apt upgrade -y'
ssh -t pi@host3 'sudo apt update && sudo apt upgrade -y'
ssh -t pi@host4 'sudo apt update && sudo apt upgrade -y'
Last edited by jahboater on Sat Jan 18, 2020 11:53 pm, edited 1 time in total.

DarrenHill
Posts: 246
Joined: Fri Oct 03, 2014 3:03 pm

Re: Updating Pis

Sat Jan 18, 2020 8:31 am

You could also look at the unattended-upgrades apt module (via an apt-get install).

https://github.com/voxpupuli/puppet-unattended_upgrades

iznobe
Posts: 424
Joined: Sun Feb 05, 2017 4:14 pm
Location: Avignon , FRANCE

Re: Updating Pis

Sat Jan 18, 2020 12:51 pm

Maze_fr wrote:
Fri Jan 17, 2020 4:41 pm
Maybe you could put all your command line in one script and launch it in a cron ?
Hi , it seems to me that it is the simplest way ;)

User avatar
bensimmo
Posts: 4307
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Updating Pis

Sat Jan 18, 2020 1:41 pm

jahboater wrote:
Fri Jan 17, 2020 4:41 pm
cooka wrote:
Fri Jan 17, 2020 4:26 pm
:geek: Hi guys,

I have been using raspberry pis for a while but new to the forum. I was wondering if such a thing exists, I currently have 50+ rpis deployed at different sites, all they run is a chrome page in kiosk mode mainly. I would like to keep them all up to date etc without having to manually ssl/vnc into each one. Is there a way I can put them in one place, have them check in on my network and update them automatically?

Can i do anything with linux server?

Any suggestions welcome.
You could have a simple script.
Something like:

ssh pi@host1 'sudo apt-get update && sudo apt-get upgrade -y'
ssh pi@host2 'sudo apt-get update && sudo apt-get upgrade -y'
ssh pi@host3 'sudo apt-get update && sudo apt-get upgrade -y'
ssh pi@host4 'sudo apt-get update && sudo apt-get upgrade -y'
Great in theory, let down by some updates giving you information and waiting on your input.
(At which point I think you need the unattended thing posted ?)

DarkElvenAngel
Posts: 381
Joined: Tue Mar 20, 2018 9:53 pm

Re: Updating Pis

Sat Jan 18, 2020 3:38 pm

I would suggest that if you have a server have each device check in and report some status and your server can instruct the kiosk to start a remote update if updates are available.

I'm presuming that these units are not somewhere you want to travel to and check on all the time and with this method you can test the update on a location close by and then have your field units update in blocks so if something doesn't work you can figure it out before it gets out of hand.

Having them check in would also let you know if a remote unit has gone down or there is some other technical issues on site that would need to be addressed.

The nature of how this works is up to you and it affords you greater control and knowledge of remote units without having to check on them. I would strongly recommend against having units update them selves when they want. You need to have control so if something goes wrong you know how to fix it before you have 50+ units all down because they have updated and broken something.

jahboater
Posts: 5175
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Updating Pis

Sat Jan 18, 2020 6:17 pm

bensimmo,
bensimmo wrote:
Sat Jan 18, 2020 1:41 pm
Great in theory, let down by some updates giving you information and waiting on your input.
(At which point I think you need the unattended thing posted ?)
That's why I gave the -y option.

Code: Select all

ssh pi@host1 'sudo apt-get update && sudo apt-get upgrade -y'
The man page says:

Code: Select all

-y, --yes, --assume-yes
    Automatic yes to prompts; assume "yes" as answer to all prompts and run
    non-interactively. If an undesirable situation, such as changing a held package,
    trying to install a unauthenticated package or removing an essential package occurs
    then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.
it is explicitly for non-interactive runs.
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

User avatar
bensimmo
Posts: 4307
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Updating Pis

Sat Jan 18, 2020 8:24 pm

I think the -y only refer to, continue at the start, when it tells you there are so many updates etc and asks.do you really want to do this.
It does not 'yes' to blocking info screens*, which has happened a lot with some of the updates. I think SSH was one and another were a default whatsitsmejig is now different.

At least that's how it works for me. Though I use apt not apt-get more often now, unless I have to use apt-get.

*I think these come up and you have to q-quit out of them.

jahboater
Posts: 5175
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Updating Pis

Sat Jan 18, 2020 11:52 pm

bensimmo wrote:
Sat Jan 18, 2020 8:24 pm
It does not 'yes' to blocking info screens*, which has happened a lot with some of the updates.
I think its when a config file has been altered by the user.
bensimmo wrote:
Sat Jan 18, 2020 8:24 pm
At least that's how it works for me. Though I use apt not apt-get more often now, unless I have to use apt-get.
So do I, apt is much nicer. But when I use it remotely over ssh I get this message:

Code: Select all

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
I found the old apt-get worked fine.

I just tried the -t option for ssh and apt now works without the message.

Code: Select all

ssh -t pi@host 'sudo apt update && sudo apt full-upgrade -y'
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

Return to “Networking and servers”